@@ -63,7 +63,9 @@ defmodule LiveDebuggerWeb.Hooks.LinkedView do
6363 PubSubUtils . process_status_topic ( )
6464 |> PubSubUtils . subscribe! ( )
6565
66- LiveDebugger.GenServers.EtsTableServer . watch ( fetched_lv_process . pid )
66+ if LiveDebugger.Env . dead_view_mode? ( ) do
67+ LiveDebugger.GenServers.EtsTableServer . watch ( fetched_lv_process . pid )
68+ end
6769
6870 socket
6971 |> assign ( :lv_process , AsyncResult . ok ( fetched_lv_process ) )
@@ -83,6 +85,12 @@ defmodule LiveDebuggerWeb.Hooks.LinkedView do
8385
8486 def handle_async ( _ , _ , socket ) , do: { :cont , socket }
8587
88+ def handle_info ( :find_successor , socket ) do
89+ socket
90+ |> find_successor_lv_process ( )
91+ |> halt ( )
92+ end
93+
8694 def handle_info (
8795 { :process_status , { :died , pid } } ,
8896 % { assigns: % { lv_process: % { result: % LvProcess { pid: pid } } } } = socket
@@ -93,7 +101,17 @@ defmodule LiveDebuggerWeb.Hooks.LinkedView do
93101 |> halt ( )
94102 end
95103
96- def handle_info ( { :process_status , _ } , socket ) , do: halt ( socket )
104+ def handle_info (
105+ { :process_status , { :dead , pid } } ,
106+ % { assigns: % { lv_process: % { result: % LvProcess { pid: pid } } } } = socket
107+ ) do
108+ if LiveDebugger.Env . dead_view_mode? ( ) do
109+ socket
110+ else
111+ find_successor_lv_process ( socket )
112+ end
113+ |> halt ( )
114+ end
97115
98116 def handle_info ( _ , socket ) , do: { :cont , socket }
99117
0 commit comments