From c3ebaab58d55ac66ef45dd6bf454248d9bc11a9c Mon Sep 17 00:00:00 2001 From: Mathias Date: Tue, 9 Aug 2022 16:50:46 +0200 Subject: [PATCH] Fixed the pause controller --- server/controller/pause.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/controller/pause.js b/server/controller/pause.js index c5d83553..54a22b9e 100644 --- a/server/controller/pause.js +++ b/server/controller/pause.js @@ -8,11 +8,15 @@ module.exports.updateState = function(newState) { // Update the current state in a specific time module.exports.resumeIn = function(time) { + if (isNaN(time)) return; + if (updateTimer !== null) clearTimeout(updateTimer); this.updateState(true); updateTimer = setTimeout(() => this.updateState(false), time * 3600000); // time in hours + + return true; } module.exports.currentState = currentState; \ No newline at end of file