From 15627fc494361acc999c114d7fc34991bf124370 Mon Sep 17 00:00:00 2001 From: c4ch3c4d3 <23181631+c4ch3c4d3@users.noreply.github.com> Date: Fri, 14 Aug 2026 12:58:06 -0600 Subject: [PATCH] fix: clear the spark sampler when switching to usage display mode --- src/actions/inflight-monitor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/actions/inflight-monitor.ts b/src/actions/inflight-monitor.ts index 61fd1b0..e8443e2 100644 --- a/src/actions/inflight-monitor.ts +++ b/src/actions/inflight-monitor.ts @@ -76,9 +76,11 @@ export class InflightMonitor extends SingletonAction { runtime.ensureConnections(cfgFromSettings(state.settings)); state.unwatchStats?.(); state.unwatchStats = undefined; + if (state.sampler) clearInterval(state.sampler); + state.sampler = undefined; if (this.displayOf(state) === "usage") { state.unwatchStats = runtime.watchStats(this.modelKeyOf(state)); - } else if (!state.sampler) { + } else { state.sampler = setInterval(() => this.sample(state), 1000); } this.render(state);