From 20b8a9d7e9822fe1878cedee0dfd2393e73bb33f Mon Sep 17 00:00:00 2001 From: yangdx Date: Thu, 13 Mar 2025 13:00:03 +0800 Subject: [PATCH] Remove redundant label fetch on mount --- lightrag_webui/src/hooks/useLightragGraph.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lightrag_webui/src/hooks/useLightragGraph.tsx b/lightrag_webui/src/hooks/useLightragGraph.tsx index dc3294cf..e2ce5943 100644 --- a/lightrag_webui/src/hooks/useLightragGraph.tsx +++ b/lightrag_webui/src/hooks/useLightragGraph.tsx @@ -169,11 +169,6 @@ const useLightrangeGraph = () => { const minDegree = useSettingsStore.use.graphMinDegree() const isFetching = useGraphStore.use.isFetching() - // Fetch all database labels on mount - useEffect(() => { - useGraphStore.getState().fetchAllDatabaseLabels() - }, []) - // Use ref to track fetch status const fetchStatusRef = useRef>({}); @@ -276,6 +271,7 @@ const useLightrangeGraph = () => { const state = useGraphStore.getState() state.reset() state.setSigmaGraph(new DirectedGraph()) + state.setGraphLabels(['*']) } }, [queryLabel, maxQueryDepth, minDegree, isFetching])