Skip to content

Commit

Permalink
fix(last-login): use users last login instead of test value, resolve …
Browse files Browse the repository at this point in the history
…credo error
  • Loading branch information
akinsey committed Nov 14, 2024
1 parent b9cefea commit dfd0a30
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/epochtalk_server_web/json/user_json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,13 @@ defmodule EpochtalkServerWeb.Controllers.UserJSON do
_ -> d
end

{:ok, last_login} = DateTime.from_unix(1731427963000, :millisecond)
{:ok, last_login} = DateTime.from_unix(user.last_login, :millisecond)
last_login_past_72_hours = DateTime.diff(DateTime.utc_now, last_login, :hour) > 72

last_active = if user.show_online == 1 or last_login_past_72_hours,
do: user.last_login,
else: nil

user = if user.title == "",
do: user |> Map.delete(:title),
else: user

user
|> Map.put(:signature, parsed_signature)
|> Map.put(:gender, gender)
Expand Down

0 comments on commit dfd0a30

Please sign in to comment.