Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: sync all settings actions in SH (#4263)

James George559c71e39be6
diff --git a/packages/hoppscotch-selfhost-desktop/src/lib/sync/index.ts b/packages/hoppscotch-selfhost-desktop/src/lib/sync/index.ts
index 1427e600d..dd776ee2a 100644
--- a/packages/hoppscotch-selfhost-desktop/src/lib/sync/index.ts
+++ b/packages/hoppscotch-selfhost-desktop/src/lib/sync/index.ts
@@ -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 {
diff --git a/packages/hoppscotch-selfhost-desktop/src/platform/settings/settings.sync.ts b/packages/hoppscotch-selfhost-desktop/src/platform/settings/settings.sync.ts
index 19df5001a..bc42556c5 100644
--- a/packages/hoppscotch-selfhost-desktop/src/platform/settings/settings.sync.ts
+++ b/packages/hoppscotch-selfhost-desktop/src/platform/settings/settings.sync.ts
@@ -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(
diff --git a/packages/hoppscotch-selfhost-web/src/lib/sync/index.ts b/packages/hoppscotch-selfhost-web/src/lib/sync/index.ts
index 1427e600d..dd776ee2a 100644
--- a/packages/hoppscotch-selfhost-web/src/lib/sync/index.ts
+++ b/packages/hoppscotch-selfhost-web/src/lib/sync/index.ts
@@ -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 {
diff --git a/packages/hoppscotch-selfhost-web/src/platform/settings/settings.sync.ts b/packages/hoppscotch-selfhost-web/src/platform/settings/settings.sync.ts
index 19df5001a..bc42556c5 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/settings/settings.sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/settings/settings.sync.ts
@@ -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(