diff options
Diffstat (limited to 'gui/src/shared')
| -rw-r--r-- | gui/src/shared/scheduler.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gui/src/shared/scheduler.ts b/gui/src/shared/scheduler.ts index af28a7e95b..902254c567 100644 --- a/gui/src/shared/scheduler.ts +++ b/gui/src/shared/scheduler.ts @@ -1,12 +1,14 @@ export class Scheduler { - private timer?: number; + private timer?: NodeJS.Timeout; public schedule(action: () => void, delay: number) { this.cancel(); - this.timer = setTimeout(action, delay); + this.timer = global.setTimeout(action, delay); } public cancel() { - clearTimeout(this.timer); + if (this.timer) { + clearTimeout(this.timer); + } } } |
