Skip to content

Commit e0da6b6

Browse files
authored
fix: multiple user diffs in staff listing page (#523)
1 parent 675f20b commit e0da6b6

File tree

1 file changed

+3
-1
lines changed
  • lib/safira_web/live/backoffice/staff_live

1 file changed

+3
-1
lines changed

lib/safira_web/live/backoffice/staff_live/index.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ defmodule SafiraWeb.Backoffice.StaffLive.Index do
6868
end
6969

7070
defp maybe_update_staff_presence(staff, diff, value) do
71-
case Enum.find(diff, fn {_, %{metas: [data]}} -> data.id == staff.id end) do
71+
case Enum.find(diff, fn {_, %{metas: metas}} ->
72+
Enum.any?(metas, fn meta -> meta.id == staff.id end)
73+
end) do
7274
nil -> staff
7375
_ -> Map.put(staff, :is_online, value)
7476
end

0 commit comments

Comments
 (0)