fix(app): invalidate provider queries after config update to show custom providers immediately (#28313)

This commit is contained in:
Shawn 2026-05-19 20:31:36 +08:00 committed by GitHub
parent 922b2e10eb
commit 2932a7a35d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -422,7 +422,13 @@ function createGlobalSync() {
const updateConfigMutation = useMutation(() => ({
mutationFn: (config: Config) => globalSDK.client.global.config.update({ config }),
onSuccess: () => bootstrap.refetch(),
onSuccess: () => {
bootstrap.refetch()
// Invalidate all provider queries so newly configured custom providers
// appear immediately in the available provider list across all directories.
queryClient.invalidateQueries({ queryKey: [null, "providers"] })
queryClient.invalidateQueries({ predicate: (query) => query.queryKey[1] === "providers" })
},
}))
return {