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}
 | 
			
		||||
  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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue