fix(ui): fix config save button persisting after save on agent configure page
The parent query for agent detail uses routeAgentRef (URL key like "claudecoder") in its cache key, but ConfigurationTab and rollbackConfig only invalidated by agent.id (UUID). This meant the refetch never fired when navigating by URL key, so the dirty overlay was never cleared and the save button stayed visible indefinitely. Add urlKey-based invalidation to match the pattern already used by other mutations in the parent component. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c1f0b33d16
commit
8873dd793f
1 changed files with 2 additions and 0 deletions
|
|
@ -1057,6 +1057,7 @@ function AgentConfigurePage({
|
|||
mutationFn: (revisionId: string) => agentsApi.rollbackConfigRevision(agent.id, revisionId, companyId),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.agents.detail(agent.id) });
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.agents.detail(agent.urlKey) });
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.agents.configRevisions(agent.id) });
|
||||
},
|
||||
});
|
||||
|
|
@ -1161,6 +1162,7 @@ function ConfigurationTab({
|
|||
mutationFn: (data: Record<string, unknown>) => agentsApi.update(agent.id, data, companyId),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.agents.detail(agent.id) });
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.agents.detail(agent.urlKey) });
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.agents.configRevisions(agent.id) });
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue