Skip to content

Commit

Permalink
Ensure we don't send time events after they've been cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
curiousdannii committed Oct 20, 2024
1 parent efaad03 commit c9f9e13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/glkapi/glkapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion src/glkote/common/glkote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'})
}
}
Expand Down

0 comments on commit c9f9e13

Please sign in to comment.