fix: prerender library page without localStorage (#439)

This commit is contained in:
Huang Xin
2025-02-23 17:04:02 +01:00
committed by GitHub
parent 1ff929ece5
commit 9e7e41a623
@@ -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,