fuzzyworld

north-star / commit

default to on for stay awake

d193c692367595a59166c5e344c1071777e1eaa0 · Pavel Safronov · 2026-03-16 11:24:20 -0700 · parents f495a654df95

default to on for stay awake
 src/wake-lock-controller.ts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/wake-lock-controller.ts b/src/wake-lock-controller.ts
index 0ba00bb..aa4a0b6 100644
--- a/src/wake-lock-controller.ts
+++ b/src/wake-lock-controller.ts
@@ -19,7 +19,8 @@ export const initWakeLockController = ({
         hasWakeLockSupport
     } = createWakeLockManager();
 
-    let wakeLockEnabledByToggle = localStorage.getItem(WAKE_LOCK_ENABLED_STORAGE_KEY) === '1';
+    const savedWakeLockPreference = localStorage.getItem(WAKE_LOCK_ENABLED_STORAGE_KEY);
+    let wakeLockEnabledByToggle = savedWakeLockPreference !== '0';
     const wakeLockToast = createToast({ className: 'wake-lock-toast' });
 
     const getEffectiveWakeLockEnabled = () => isSessionStarted() && (isFullscreen() || wakeLockEnabledByToggle);