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:
waleed
2026-03-09 20:29:06 -07:00
parent 80f032b9be
commit 4ccc1e5997
+5 -1
View File
@@ -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,
})
}