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