CRITICAL FIX: Remove inactivityExtensionUntil=0 from markActivity()
This was the root cause of extensions not working. When user clicked extension buttons (15 min, 30 min, etc.), that click triggered markActivity() which immediately cleared the extension that was just set. Now extensions work correctly - they only expire when: - Time runs out naturally - User explicitly goes home - User cancels the extension This fixes: - Pause button extensions not working (rotating after 1 min) - Manual site timeout extensions not working (prompt after 1 min) - Both rotation and inactivity timer extensions
This commit is contained in:
@@ -3791,21 +3791,24 @@ console.log('[CONFIG] Pause button:',enablePauseButton); console.log('[CONFIG
|
||||
function markActivity(){
|
||||
const now=Date.now();
|
||||
const timeSinceLastActivity=now-lastUserInteraction;
|
||||
|
||||
|
||||
if(timeSinceLastActivity>5000){
|
||||
console.log('[ACTIVITY] User interaction detected');
|
||||
}
|
||||
|
||||
|
||||
lastUserInteraction=now;
|
||||
userRecentlyActive=true;
|
||||
|
||||
|
||||
if(promptWindow&&!promptWindow.isDestroyed()){
|
||||
console.log('[ACTIVITY] Closing inactivity prompt');
|
||||
promptWindow.close();
|
||||
promptWindow=null;
|
||||
}
|
||||
|
||||
inactivityExtensionUntil=0;
|
||||
|
||||
// CRITICAL FIX: Don't clear extensions on activity
|
||||
// Extensions should only expire naturally or be explicitly cancelled
|
||||
// If user is active, they're using the current site - extension should remain
|
||||
// inactivityExtensionUntil=0; // REMOVED - was breaking extensions
|
||||
|
||||
// Reset lockout timer on activity
|
||||
if(enablePasswordProtection&&lockoutTimeout>0&&!isLockedOut){
|
||||
|
||||
Reference in New Issue
Block a user