fix: sync all settings actions in SH (#4263)
This commit is contained in:
parent
775051bac3
commit
559c71e39b
4 changed files with 22 additions and 4 deletions
|
|
@ -80,7 +80,7 @@ export const getSyncInitFunction = <T extends DispatchingStore<any, any>>(
|
|||
)
|
||||
}
|
||||
|
||||
stopSubscriptions = startSubscriptions()
|
||||
stopSubscriptions = startSubscriptions?.()
|
||||
}
|
||||
|
||||
function stopListeningToSubscriptions() {
|
||||
|
|
@ -90,7 +90,7 @@ export const getSyncInitFunction = <T extends DispatchingStore<any, any>>(
|
|||
)
|
||||
}
|
||||
|
||||
stopSubscriptions()
|
||||
stopSubscriptions?.()
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -9,9 +9,18 @@ import { updateUserSettings } from "./settings.api"
|
|||
export const settingsSyncDefinition: StoreSyncDefinitionOf<
|
||||
typeof settingsStore
|
||||
> = {
|
||||
toggleSetting() {
|
||||
updateUserSettings(JSON.stringify(settingsStore.value))
|
||||
},
|
||||
toggleNestedSetting() {
|
||||
updateUserSettings(JSON.stringify(settingsStore.value))
|
||||
},
|
||||
applySetting() {
|
||||
updateUserSettings(JSON.stringify(settingsStore.value))
|
||||
},
|
||||
applyNestedSetting() {
|
||||
updateUserSettings(JSON.stringify(settingsStore.value))
|
||||
},
|
||||
}
|
||||
|
||||
export const settingsSyncer = getSyncInitFunction(
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ export const getSyncInitFunction = <T extends DispatchingStore<any, any>>(
|
|||
)
|
||||
}
|
||||
|
||||
stopSubscriptions = startSubscriptions()
|
||||
stopSubscriptions = startSubscriptions?.()
|
||||
}
|
||||
|
||||
function stopListeningToSubscriptions() {
|
||||
|
|
@ -90,7 +90,7 @@ export const getSyncInitFunction = <T extends DispatchingStore<any, any>>(
|
|||
)
|
||||
}
|
||||
|
||||
stopSubscriptions()
|
||||
stopSubscriptions?.()
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -9,9 +9,18 @@ import { updateUserSettings } from "./settings.api"
|
|||
export const settingsSyncDefinition: StoreSyncDefinitionOf<
|
||||
typeof settingsStore
|
||||
> = {
|
||||
toggleSetting() {
|
||||
updateUserSettings(JSON.stringify(settingsStore.value))
|
||||
},
|
||||
toggleNestedSetting() {
|
||||
updateUserSettings(JSON.stringify(settingsStore.value))
|
||||
},
|
||||
applySetting() {
|
||||
updateUserSettings(JSON.stringify(settingsStore.value))
|
||||
},
|
||||
applyNestedSetting() {
|
||||
updateUserSettings(JSON.stringify(settingsStore.value))
|
||||
},
|
||||
}
|
||||
|
||||
export const settingsSyncer = getSyncInitFunction(
|
||||
|
|
|
|||
Loading…
Reference in a new issue