fix: add missing handle_info for state_sensors_updated in GraphLive.Show

Adds handler to reload graph data when state sensors are updated via PubSub,
preventing GenServer crash when viewing graph page during sensor updates.
This commit is contained in:
Graham McIntire 2026-02-05 09:14:21 -06:00
parent 0d6caa897f
commit 912cb8d280
No known key found for this signature in database

View file

@ -602,6 +602,12 @@ defmodule ToweropsWeb.GraphLive.Show do
{:noreply, assign(socket, :device, device)}
end
# Handle sensor updates from PubSub
@impl true
def handle_info({:state_sensors_updated, _device_id}, socket) do
{:noreply, load_graph_data(socket)}
end
# Handle live poll event
@impl true
def handle_info(:live_poll, socket) do