We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8418e24 commit 0f77924Copy full SHA for 0f77924
1 file changed
lib/live_debugger_web/live/state_live.ex
@@ -100,9 +100,20 @@ defmodule LiveDebuggerWeb.StateLive do
100
end
101
102
@impl true
103
- def handle_info({:node_changed, node_id}, socket) do
+ def handle_info({:node_changed, new_node_id}, socket) do
104
+ lv_process = socket.assigns.lv_process
105
+ old_node_id = socket.assigns.node_id
106
+
107
+ lv_process.socket_id
108
+ |> PubSubUtils.state_changed_topic(lv_process.transport_pid, old_node_id)
109
+ |> PubSubUtils.unsubscribe()
110
111
112
+ |> PubSubUtils.state_changed_topic(lv_process.transport_pid, new_node_id)
113
+ |> PubSubUtils.subscribe!()
114
115
socket
- |> assign(node_id: node_id)
116
+ |> assign(node_id: new_node_id)
117
|> assign_async_node_with_type()
118
|> noreply()
119
0 commit comments