yangdx commited on
Commit
d98214a
·
1 Parent(s): 214b2a7

Remove redundant label fetch on mount

Browse files
lightrag_webui/src/hooks/useLightragGraph.tsx CHANGED
@@ -169,11 +169,6 @@ const useLightrangeGraph = () => {
169
  const minDegree = useSettingsStore.use.graphMinDegree()
170
  const isFetching = useGraphStore.use.isFetching()
171
 
172
- // Fetch all database labels on mount
173
- useEffect(() => {
174
- useGraphStore.getState().fetchAllDatabaseLabels()
175
- }, [])
176
-
177
  // Use ref to track fetch status
178
  const fetchStatusRef = useRef<Record<string, boolean>>({});
179
 
@@ -276,6 +271,7 @@ const useLightrangeGraph = () => {
276
  const state = useGraphStore.getState()
277
  state.reset()
278
  state.setSigmaGraph(new DirectedGraph())
 
279
  }
280
  }, [queryLabel, maxQueryDepth, minDegree, isFetching])
281
 
 
169
  const minDegree = useSettingsStore.use.graphMinDegree()
170
  const isFetching = useGraphStore.use.isFetching()
171
 
 
 
 
 
 
172
  // Use ref to track fetch status
173
  const fetchStatusRef = useRef<Record<string, boolean>>({});
174
 
 
271
  const state = useGraphStore.getState()
272
  state.reset()
273
  state.setSigmaGraph(new DirectedGraph())
274
+ state.setGraphLabels(['*'])
275
  }
276
  }, [queryLabel, maxQueryDepth, minDegree, isFetching])
277