mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 13:29:44 +02:00
fix(agents): navigate to detail page before invalidating list query (#1897)
After creating an agent from the empty state, the query invalidation triggered a refetch that re-rendered the agents list page (empty → list) before navigation to the detail page completed, causing a visible flash. Move navigation.push() before qc.invalidateQueries() so the user lands on the detail page immediately; the list refetch happens in the background after we've already left.
This commit is contained in:
@@ -279,10 +279,10 @@ export function AgentsPage() {
|
||||
// Surfaced softly; the agent itself is fine.
|
||||
}
|
||||
}
|
||||
qc.invalidateQueries({ queryKey: workspaceKeys.agents(wsId) });
|
||||
setShowCreate(false);
|
||||
setDuplicateTemplate(null);
|
||||
navigation.push(paths.agentDetail(agent.id));
|
||||
qc.invalidateQueries({ queryKey: workspaceKeys.agents(wsId) });
|
||||
};
|
||||
|
||||
const handleDuplicate = useCallback((agent: Agent) => {
|
||||
|
||||
Reference in New Issue
Block a user