app(fix): only update health updates on its own page

This commit is contained in:
Nikos Papadakis 2023-11-25 15:29:59 +02:00
parent efd5f1d126
commit c81d112eb8
Signed by untrusted user who does not match committer: nikos
GPG key ID: 78871F9905ADFF02

View file

@ -171,8 +171,13 @@ defmodule PrymnWeb.ServerLive.Show do
{:noreply, socket}
end
def handle_info(%Agents.Health{} = health, socket) do
{:noreply, assign(socket, :health, health)}
def handle_info(%Agents.Health{host: host} = health, socket) do
socket =
if host == socket.assigns.server.public_ip,
do: assign(socket, :health, health),
else: socket
{:noreply, socket}
end
@impl true