mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-06-13 01:34:58 +08:00
fix: invalidate OMO Slim query cache after provider mutations
OMO Slim queries (["omo-slim", ...]) were not invalidated alongside OMO queries, causing stale UI state when switching/adding/deleting OMO Slim providers.
This commit is contained in:
@@ -57,6 +57,12 @@ export const useAddProviderMutation = (appId: AppId) => {
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: ["omo", "provider-count"],
|
||||
});
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: ["omo-slim", "current-provider-id"],
|
||||
});
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: ["omo-slim", "provider-count"],
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -139,6 +145,12 @@ export const useDeleteProviderMutation = (appId: AppId) => {
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: ["omo", "provider-count"],
|
||||
});
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: ["omo-slim", "current-provider-id"],
|
||||
});
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: ["omo-slim", "provider-count"],
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -190,6 +202,9 @@ export const useSwitchProviderMutation = (appId: AppId) => {
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: ["omo", "current-provider-id"],
|
||||
});
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: ["omo-slim", "current-provider-id"],
|
||||
});
|
||||
}
|
||||
if (appId === "openclaw") {
|
||||
await queryClient.invalidateQueries({
|
||||
|
||||
Reference in New Issue
Block a user