IKHSAN
EN Read in EnglishID

pixies

Publik
Branch
master
Commit terakhir
9b0697f26 Oktober 2026

pause.js

Buka raw
let currentStateVar = false;
let updateTimer;

export const updateState = (newState) => {
    currentStateVar = newState;
}

export const resumeIn = (hours) => {
    if (/[^0-9]/.test(hours)) return false;


    if (updateTimer !== null) 
        clearTimeout(updateTimer);

    updateState(true);
    updateTimer = setTimeout(() => updateState(false), hours * 3600000); // time in hours

    return true;
}

export { currentStateVar as currentState };
byte
452
baris
21
Jenis
js
Commit terakhir
26 Oktober 2026