fix: reset userSettings first login

This commit is contained in:
jialin
2025-12-25 13:14:59 +08:00
parent 73b987358f
commit 9dcdb6b6e7
10 changed files with 60 additions and 23 deletions
+15
View File
@@ -1,3 +1,4 @@
import { defaultSettings } from '@/atoms/settings';
import { getDefaultStore } from 'jotai';
export const clearStorageUserSettings = () => {
@@ -18,6 +19,20 @@ export const clearStorageUserSettings = () => {
}
};
export const resetStorageUserSettings = () => {
try {
localStorage.setItem(
'userSettings',
JSON.stringify({
...defaultSettings,
colorPrimary: undefined
})
);
} catch (error) {
console.log('Error clearing user settings:', error);
}
};
export const clearAtomStorage = (atom: any) => {
if (!atom) {
return;