Skip to content

Commit 7f4718c

Browse files
committed
Change timer stopping
1 parent 9e11c9a commit 7f4718c

2 files changed

Lines changed: 8 additions & 16 deletions

File tree

assets/js/hooks/trace_execution_time.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ const TraceExecutionTime = {
55

66
this.intervalId = setInterval(() => {
77
current = Date.now() - start;
8-
98
this.el.textContent = current + ' ms';
109
}, 16);
11-
},
12-
updated() {
13-
clearInterval(this.intervalId);
10+
11+
this.handleEvent("stop-timer", () => {
12+
clearInterval(this.intervalId);
13+
})
1414
},
1515
};
1616

lib/live_debugger/live_views/traces_live.ex

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,19 +246,11 @@ defmodule LiveDebugger.LiveViews.TracesLive do
246246

247247
@impl true
248248
def handle_info({:updated_trace, trace}, socket) do
249-
socket
250-
|> TracingHelper.check_fuse()
251-
|> case do
252-
{:ok, socket} ->
253-
trace_display = TraceDisplay.from_trace(trace, true)
254-
255-
socket
256-
|> stream_insert(:existing_traces, trace_display, at: 0, limit: @live_stream_limit)
249+
trace_display = TraceDisplay.from_trace(trace, true)
257250

258-
{_, socket} ->
259-
# Add disappearing flash here in case of :stopped. (Issue 173)
260-
socket
261-
end
251+
socket
252+
|> push_event("stop-timer", %{})
253+
|> stream_insert(:existing_traces, trace_display, at: 0, limit: @live_stream_limit)
262254
|> noreply()
263255
end
264256

0 commit comments

Comments
 (0)