Fix: When re-entering the agent page, the data from the previous session flashes briefly. (#16251)

Fix: When re-entering the agent page, the data from the previous session flashes briefly.
This commit is contained in:
balibabu
2026-06-23 14:13:47 +08:00
committed by GitHub
parent 9f9433e218
commit d8ee1ffaad
2 changed files with 4 additions and 6 deletions

View File

@@ -336,7 +336,7 @@ export const useFetchAgent = (): {
isFetching: loading,
refetch,
} = useQuery({
queryKey: [AgentApiAction.FetchAgentDetail],
queryKey: [AgentApiAction.FetchAgentDetail, sharedId || id],
initialData: {} as IFlow,
refetchOnReconnect: false,
refetchOnMount: false,
@@ -426,7 +426,7 @@ export const useSetAgent = (showMessage: boolean = true) => {
});
if (agentId) {
queryClient.invalidateQueries({
queryKey: [AgentApiAction.FetchAgentDetail],
queryKey: [AgentApiAction.FetchAgentDetail, agentId],
});
}
}

View File

@@ -6,10 +6,8 @@ export const useSetGraphInfo = () => {
const { setEdges, setNodes } = useGraphStore((state) => state);
const setGraphInfo = useCallback(
({ nodes = [], edges = [] }: IGraph) => {
if (nodes.length || edges.length) {
setNodes(nodes);
setEdges(edges);
}
setNodes(nodes);
setEdges(edges);
},
[setEdges, setNodes],
);