fix: sync all settings actions in SH (#4263)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user