mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
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:
@@ -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],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user