diff --git a/lib/app/cid.ex b/lib/app/cid.ex index 731ff564..45a5adb8 100644 --- a/lib/app/cid.ex +++ b/lib/app/cid.ex @@ -13,7 +13,8 @@ defmodule App.Cid do changeset else # Only add cid to changeset that has :name i.e. list.name or :text i.e. item.text - if Map.has_key?(changeset.changes, :name) || Map.has_key?(changeset.changes, :text) do + if Map.has_key?(changeset.changes, :name) || + Map.has_key?(changeset.changes, :text) do cid = Cid.cid(changeset.changes) %{changeset | changes: Map.put(changeset.changes, :cid, cid)} else diff --git a/lib/app/item.ex b/lib/app/item.ex index f58d57f0..ad0d00e9 100644 --- a/lib/app/item.ex +++ b/lib/app/item.ex @@ -249,7 +249,6 @@ defmodule App.Item do list_person_items(person_id) |> Enum.reduce(%{}, fn i, acc -> Map.put(acc, i.id, i) end) - accumulate_item_timers(values, seq) |> Enum.map(fn t -> if t != nil do diff --git a/lib/app_web/live/app_live.ex b/lib/app_web/live/app_live.ex index 7d9d136c..321a5a89 100644 --- a/lib/app_web/live/app_live.ex +++ b/lib/app_web/live/app_live.ex @@ -98,7 +98,13 @@ defmodule AppWeb.AppLive do # need to restrict getting items to the people who own or have rights to access them! item = Item.get_item!(Map.get(data, "id")) - Item.update_item(item, %{status: status, person_id: person_id, cid: item.cid}) + + Item.update_item(item, %{ + status: status, + person_id: person_id, + cid: item.cid + }) + Timer.stop_timer_for_item_id(item.id) AppWeb.Endpoint.broadcast(@topic, "update", :toggle)