Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Jul 14, 2022
1 parent 2a33aa7 commit b563e64
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/app_web/live/app_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ defmodule AppWeb.AppLive do
{:noreply, assign(socket, items: items, timer: timer)}
end

@impl true
def handle_info(%{event: "update", payload: %{items: items, timer: timer}}, socket) do
{:noreply, assign(socket, items: items, timer: timer)}
end

@impl true
def handle_info(%{event: "delete", payload: %{items: items, timer: timer}}, socket) do
{:noreply, assign(socket, items: items, timer: timer)}
end

# helper function that checks for status 4 (:done)
def done?(item) do
not is_nil(item.status_code) and item.status_code == 4
Expand Down

0 comments on commit b563e64

Please sign in to comment.