diff --git a/apps/web/src/hooks/useSettings.ts b/apps/web/src/hooks/useSettings.ts index 3dc2cf9b20..a94ec061c1 100644 --- a/apps/web/src/hooks/useSettings.ts +++ b/apps/web/src/hooks/useSettings.ts @@ -61,10 +61,16 @@ async function hydrateClientSettings(): Promise { } const nextHydration = (async () => { + const snapshotBeforeHydration = clientSettingsSnapshot; try { const persistedSettings = await ensureLocalApi().persistence.getClientSettings(); if (persistedSettings) { - replaceClientSettingsSnapshot(persistedSettings); + const currentSnapshot = clientSettingsSnapshot; + if (currentSnapshot !== snapshotBeforeHydration) { + replaceClientSettingsSnapshot({ ...persistedSettings, ...currentSnapshot }); + } else { + replaceClientSettingsSnapshot(persistedSettings); + } } } catch (error) { console.error(`${CLIENT_SETTINGS_PERSISTENCE_ERROR_SCOPE} hydrate failed`, error);