mirror of
https://github.com/simstudioai/sim.git
synced 2026-10-25 09:34:44 +08:00
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.
This commit is contained in:
@@ -83,7 +83,11 @@ export function useGeneralSettings() {
|
||||
export function prefetchGeneralSettings(queryClient: QueryClient) {
|
||||
queryClient.prefetchQuery({
|
||||
queryKey: generalSettingsKeys.settings(),
|
||||
queryFn: () => fetchGeneralSettings(),
|
||||
queryFn: async () => {
|
||||
const settings = await fetchGeneralSettings()
|
||||
syncThemeToNextThemes(settings.theme)
|
||||
return settings
|
||||
},
|
||||
staleTime: 60 * 60 * 1000,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user