From 20a09d3d279deef6c15cd12a7130686b9cd02538 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 1 Feb 2020 17:51:42 -0500 Subject: [PATCH] Fixed type errors. --- src/js-components/skipNotice.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js-components/skipNotice.ts b/src/js-components/skipNotice.ts index 27d8425b..446cacd3 100644 --- a/src/js-components/skipNotice.ts +++ b/src/js-components/skipNotice.ts @@ -9,7 +9,7 @@ class SkipNotice { manualSkip: boolean; maxCountdownTime: () => number; countdownTime: any; - countdownInterval: number; + countdownInterval: NodeJS.Timeout; unskipCallback: any; idSuffix: any; @@ -28,7 +28,7 @@ class SkipNotice { //the countdown until this notice closes this.countdownTime = this.maxCountdownTime(); //the id for the setInterval running the countdown - this.countdownInterval = -1; + this.countdownInterval = null; //the unskip button's callback this.unskipCallback = this.unskip.bind(this); @@ -220,7 +220,7 @@ class SkipNotice { pauseCountdown() { //remove setInterval clearInterval(this.countdownInterval); - this.countdownInterval = -1; + this.countdownInterval = null; //reset countdown this.countdownTime = this.maxCountdownTime(); @@ -237,7 +237,7 @@ class SkipNotice { startCountdown() { //if it has already started, don't start it again - if (this.countdownInterval != -1) return; + if (this.countdownInterval !== null) return; this.countdownInterval = setInterval(this.countdown.bind(this), 1000); @@ -425,7 +425,7 @@ class SkipNotice { } //remove setInterval - if (this.countdownInterval != -1) clearInterval(this.countdownInterval); + if (this.countdownInterval !== null) clearInterval(this.countdownInterval); } }