fix(ui): guard JSON.parse(localStorage) calls with try/catch to prevent UI crashes (#25481)

This commit is contained in:
G30 authored and GitHub committed 2026-06-01 10:33:54 -07:00
1 parent bddadafa07
commit ceb1cbc009
2 files changed
+17 -6

No files matched your search

+5 -1
View File
@@ -973,7 +973,11 @@
if (userSettings) {
settings.set(userSettings.ui);
} else {
settings.set(JSON.parse(localStorage.getItem('settings') ?? '{}'));
try {
settings.set(JSON.parse(localStorage.getItem('settings') ?? '{}'));
} catch {
settings.set({});
}
}
setTextScale($settings?.textScale ?? 1);