chore: update error components for loading file failed

This commit is contained in:
jialin
2025-05-15 22:57:24 +08:00
parent 17ec70f839
commit 00a60b8948
8 changed files with 83 additions and 29 deletions
+7 -1
View File
@@ -19,7 +19,13 @@ const defaultSettings: UserSettings = {
export const getStorageUserSettings = () => {
if (typeof window === 'undefined') return defaultSettings;
try {
return JSON.parse(localStorage.getItem('userSettings') || '{}');
const savedSettings = JSON.parse(
localStorage.getItem('userSettings') || '{}'
);
return {
...defaultSettings,
...savedSettings
};
} catch {
return defaultSettings;
}