fix: settings import/export not working
This commit is contained in:
2 files changed
+7
-3
No files matched your search
@@ -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(() => {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user