Correct syntax with mix format

This commit is contained in:
Dashie 2018-04-24 14:12:23 +02:00
parent 9972678a68
commit afe892ddac
No known key found for this signature in database
GPG key ID: C2D57B325840B755

View file

@ -323,7 +323,7 @@ def increase_note_count(%User{} = user) do
end
def decrease_note_count(%User{} = user) do
note_count = (user.info["note_count"] || 0)
note_count = user.info["note_count"] || 0
note_count = if note_count <= 0, do: 0, else: note_count - 1
new_info = Map.put(user.info, "note_count", note_count)