fix: settings import/export not working

This commit is contained in:
James Xylight committed 2025-03-08 15:25:31 -08:00
1 parent bb8ba01b3c
commit 81662e6f6d
2 files changed
+7 -3

No files matched your search

+3 -1
View File
@@ -198,7 +198,9 @@ function createSettingsState(initial: Settings): Settings {
return settings
}
export let settings = createSettingsState(defaultSettings)
export let settings = createSettingsState(
JSON.parse(JSON.stringify(defaultSettings)),
)
$effect.root(() => {
$effect(() => {
+4 -2
View File
@@ -102,7 +102,7 @@
const parsed = JSON.parse(importText)
const merged = { ...defaultSettings, ...parsed }
// settings = merged
Object.assign(settings, merged)
toast({ content: $t('toast.settingsImport'), type: 'success' })
importing = false
@@ -155,7 +155,9 @@
onclick={() => {
toast({
content: $t('toast.resetSettings'),
action: () => {},
action: () => {
Object.assign(settings, defaultSettings)
},
})
}}
class="font-normal"