Skip to content

Commit 0b11c21

Browse files
committed
add autopause alert
1 parent 3d52ef1 commit 0b11c21

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/view/App.svelte

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
import InfoBar from './components/InfoBar.svelte';
1515
import TickSpinner from './components/TickSpinner.svelte';
1616
import IdleCallbackMetrics from './components/IdleCallbackMetrics.svelte';
17+
import Alert from './components/Alert.svelte';
1718
18-
let spinnerEl: TickSpinner | null = $state(null);
19+
let spinnerEl: TickSpinner | null = $state.raw(null);
20+
let autopauseAlertEl: Alert | null = $state.raw(null);
1921
let paused = $state(false);
2022
let msg: TMetrics | null = $state.raw(null);
2123
@@ -33,7 +35,10 @@
3335
const trafficDuration = now - o.metrics.collectingStartTime;
3436
3537
if (trafficDuration > MAX_TRAFFIC_DURATION_BEFORE_AUTOPAUSE) {
36-
!paused && onTogglePause();
38+
if (!paused) {
39+
onTogglePause();
40+
autopauseAlertEl?.show();
41+
}
3742
} else {
3843
portPost({
3944
msg: 'telemetry-acknowledged',
@@ -89,6 +94,11 @@
8994
<TogglePanels />
9095
<div class="divider -thin"></div>
9196
<button onclick={onTogglePause} title="Toggle pause">
97+
<Alert bind:this={autopauseAlertEl} dismissable={true} title="Autopaused"
98+
>Communication with the inspected window experienced high overload and
99+
was autopaused.<br />Try hiding panels you don't need at the moment to
100+
minimise quantity of monitored data.</Alert
101+
>
92102
{#if paused}
93103
<span class="icon -play"></span>
94104
{:else}

0 commit comments

Comments
 (0)