From c9f9e13cc94c77a0153ab148d224a79f33420888 Mon Sep 17 00:00:00 2001 From: Dannii Willis Date: Sun, 20 Oct 2024 15:57:50 +1000 Subject: [PATCH] Ensure we don't send time events after they've been cancelled --- src/glkapi/glkapi.ts | 2 +- src/glkote/common/glkote.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glkapi/glkapi.ts b/src/glkapi/glkapi.ts index 463d8c0..95783fb 100644 --- a/src/glkapi/glkapi.ts +++ b/src/glkapi/glkapi.ts @@ -248,7 +248,7 @@ export class AsyncGlk implements Interface.GlkApi { // Timer const timer = this.timer if (timer.last_interval !== timer.interval) { - state.timer = timer.interval || null + state.timer = timer.interval timer.last_interval = timer.interval } diff --git a/src/glkote/common/glkote.ts b/src/glkote/common/glkote.ts index 3734759..6da5405 100644 --- a/src/glkote/common/glkote.ts +++ b/src/glkote/common/glkote.ts @@ -296,7 +296,7 @@ export abstract class GlkOteBase implements GlkOte { } protected ontimer() { - if (!this.disabled) { + if (!this.disabled && this.timer) { this.send_event({type: 'timer'}) } }