app(fix): only update health updates on its own page
This commit is contained in:
parent
efd5f1d126
commit
c81d112eb8
1 changed files with 7 additions and 2 deletions
|
@ -171,8 +171,13 @@ defmodule PrymnWeb.ServerLive.Show do
|
||||||
{:noreply, socket}
|
{:noreply, socket}
|
||||||
end
|
end
|
||||||
|
|
||||||
def handle_info(%Agents.Health{} = health, socket) do
|
def handle_info(%Agents.Health{host: host} = health, socket) do
|
||||||
{:noreply, assign(socket, :health, health)}
|
socket =
|
||||||
|
if host == socket.assigns.server.public_ip,
|
||||||
|
do: assign(socket, :health, health),
|
||||||
|
else: socket
|
||||||
|
|
||||||
|
{:noreply, socket}
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
|
|
Loading…
Reference in a new issue