Skip to content

Commit 42deb77

Browse files
committed
fix pausing
1 parent c537df0 commit 42deb77

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

src/api-monitor-cs-main.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ import diff from './api/diff.ts';
1818

1919
let originalMetrics: TTelemetry | null;
2020
let currentMetrics: TTelemetry | null;
21-
const eachSecond = new Timer({ delay: 1e3, repetitive: true }, () => {
22-
onEachSecond();
23-
});
21+
const eachSecond = new Timer({ delay: 1e3, repetitive: true }, onEachSecond);
2422
const tick = new Timer(
2523
{ delay: TELEMETRY_FREQUENCY_1PS, repetitive: false },
2624
function apiMonitorTelemetryTick() {
@@ -56,7 +54,7 @@ windowListen((o) => {
5654
if (o.msg === EMsg.TELEMETRY_ACKNOWLEDGED) {
5755
tick.delay = adjustTelemetryDelay(o.timeOfCollection);
5856
originalMetrics = currentMetrics;
59-
tick.start();
57+
!o.paused && tick.start();
6058
} else if (
6159
o.msg === EMsg.SETTINGS &&
6260
o.settings &&

src/api/communication.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export interface TMsgTelemetry {
135135
export interface TMsgTelemetryAcknowledged {
136136
msg: EMsg.TELEMETRY_ACKNOWLEDGED;
137137
timeOfCollection: number;
138+
paused: boolean;
138139
}
139140
export interface TMsgSettings {
140141
msg: EMsg.SETTINGS;

src/api/diff.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { create, DiffPatcher } from 'jsondiffpatch';
2-
export type { Delta } from 'jsondiffpatch';
32

43
const patcher = create({
54
// used to match objects when diffing arrays, by default only === operator is used

src/view/App.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
portPost({
5353
msg: EMsg.TELEMETRY_ACKNOWLEDGED,
5454
timeOfCollection: o.timeOfCollection,
55+
paused,
5556
});
5657
}
5758

0 commit comments

Comments
 (0)