From 9e7e41a6232e05b17371a4674f82b71d73147a07 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Sun, 23 Feb 2025 17:04:02 +0100 Subject: [PATCH] fix: prerender library page without localStorage (#439) --- apps/readest-app/src/helpers/shortcuts.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/readest-app/src/helpers/shortcuts.ts b/apps/readest-app/src/helpers/shortcuts.ts index 8dbd382c..632b4f22 100644 --- a/apps/readest-app/src/helpers/shortcuts.ts +++ b/apps/readest-app/src/helpers/shortcuts.ts @@ -50,6 +50,7 @@ const DEFAULT_SHORTCUTS: ShortcutConfig = { // Load shortcuts from localStorage or fallback to defaults export const loadShortcuts = (): ShortcutConfig => { + if (typeof localStorage === 'undefined') return DEFAULT_SHORTCUTS; const customShortcuts = JSON.parse(localStorage.getItem('customShortcuts') || '{}'); return { ...DEFAULT_SHORTCUTS,