Skip to content

Commit 4ccc1e5

Browse files
committed
fix(settings): include theme sync in client-side prefetch queryFn
Hover-based prefetchGeneralSettings now calls syncThemeToNextThemes, matching the useGeneralSettings hook behavior so theme updates aren't missed when prefetch refreshes stale cache.
1 parent 80f032b commit 4ccc1e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/sim/hooks/queries/general-settings.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ export function useGeneralSettings() {
8383
export function prefetchGeneralSettings(queryClient: QueryClient) {
8484
queryClient.prefetchQuery({
8585
queryKey: generalSettingsKeys.settings(),
86-
queryFn: () => fetchGeneralSettings(),
86+
queryFn: async () => {
87+
const settings = await fetchGeneralSettings()
88+
syncThemeToNextThemes(settings.theme)
89+
return settings
90+
},
8791
staleTime: 60 * 60 * 1000,
8892
})
8993
}

0 commit comments

Comments
 (0)