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
|
return settings
|
||||||
}
|
}
|
||||||
|
|
||||||
export let settings = createSettingsState(defaultSettings)
|
export let settings = createSettingsState(
|
||||||
|
JSON.parse(JSON.stringify(defaultSettings)),
|
||||||
|
)
|
||||||
|
|
||||||
$effect.root(() => {
|
$effect.root(() => {
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
const parsed = JSON.parse(importText)
|
const parsed = JSON.parse(importText)
|
||||||
const merged = { ...defaultSettings, ...parsed }
|
const merged = { ...defaultSettings, ...parsed }
|
||||||
|
|
||||||
// settings = merged
|
Object.assign(settings, merged)
|
||||||
|
|
||||||
toast({ content: $t('toast.settingsImport'), type: 'success' })
|
toast({ content: $t('toast.settingsImport'), type: 'success' })
|
||||||
importing = false
|
importing = false
|
||||||
@@ -155,7 +155,9 @@
|
|||||||
onclick={() => {
|
onclick={() => {
|
||||||
toast({
|
toast({
|
||||||
content: $t('toast.resetSettings'),
|
content: $t('toast.resetSettings'),
|
||||||
action: () => {},
|
action: () => {
|
||||||
|
Object.assign(settings, defaultSettings)
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
class="font-normal"
|
class="font-normal"
|
||||||
|
|||||||
Reference in new issue
Block a user