File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
lib/live_debugger/app/debugger/web/live_components Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ defmodule LiveDebugger.App.Debugger.Web.LiveComponents.NodeBasicInfo do
99 alias LiveDebugger.App.Debugger.Queries.Node , as: NodeQueries
1010 alias LiveDebugger.App.Debugger.Web.LiveComponents.SendEventFullscreen
1111 alias LiveDebugger.App.Utils.Parsers
12- alias Phoenix.LiveView.JS
1312
1413 @ impl true
1514 def update ( assigns , socket ) do
@@ -69,7 +68,8 @@ defmodule LiveDebugger.App.Debugger.Web.LiveComponents.NodeBasicInfo do
6968 size = "sm "
7069 id = "send-event-button "
7170 disabled = { not @ lv_process . alive? }
72- phx-click = { JS . dispatch ( "open" , to: "#send-event-fullscreen" ) }
71+ phx-click = "open-send-event "
72+ phx-target = { @ myself }
7373 >
7474 < . icon name = "icon-send " class = "w-4 h-4 " /> Send Event
7575 </ . button >
@@ -86,6 +86,18 @@ defmodule LiveDebugger.App.Debugger.Web.LiveComponents.NodeBasicInfo do
8686 """
8787 end
8888
89+ @ impl true
90+ def handle_event ( "open-send-event" , _ , socket ) do
91+ send_update ( SendEventFullscreen ,
92+ id: "send-event-fullscreen" ,
93+ reset_form?: true
94+ )
95+
96+ socket
97+ |> push_event ( "send-event-fullscreen-open" , % { } )
98+ |> noreply ( )
99+ end
100+
89101 defp assign_node_type ( socket ) do
90102 node_type =
91103 socket . assigns . node_id
Original file line number Diff line number Diff line change @@ -21,6 +21,14 @@ defmodule LiveDebugger.App.Debugger.Web.LiveComponents.SendEventFullscreen do
2121 { "handle_cast/2" , "handle_cast/2" }
2222 ]
2323
24+ @ impl true
25+ def update ( % { reset_form?: true } , socket ) do
26+ socket
27+ |> assign ( :message_error , nil )
28+ |> assign_form ( )
29+ |> ok ( )
30+ end
31+
2432 @ impl true
2533 def update ( assigns , socket ) do
2634 socket
You can’t perform that action at this time.
0 commit comments