mirror of
https://github.com/gnmyt/myspeed.git
synced 2026-01-05 12:39:40 -06:00
Fixed the pause controller
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user