yangdx commited on
Commit
b63eb5d
·
1 Parent(s): 8cea635

Optimize dependency arrays in graph components

Browse files

- Add `t` to `GraphLabels` dependency array
- Add `isFetching` to `useLightragGraph` dependencies

lightrag/api/webui/assets/{index-fJflQM9b.js → index-Deh3-0KJ.js} RENAMED
Binary files a/lightrag/api/webui/assets/index-fJflQM9b.js and b/lightrag/api/webui/assets/index-Deh3-0KJ.js differ
 
lightrag/api/webui/index.html CHANGED
Binary files a/lightrag/api/webui/index.html and b/lightrag/api/webui/index.html differ
 
lightrag_webui/src/components/graph/GraphLabels.tsx CHANGED
@@ -49,7 +49,7 @@ const GraphLabels = () => {
49
  ? result
50
  : [...result.slice(0, labelListLimit), t('graphLabels.andOthers', { count: result.length - labelListLimit })]
51
  },
52
- [getSearchEngine]
53
  )
54
 
55
  const setQueryLabel = useCallback((newLabel: string) => {
 
49
  ? result
50
  : [...result.slice(0, labelListLimit), t('graphLabels.andOthers', { count: result.length - labelListLimit })]
51
  },
52
+ [getSearchEngine, t]
53
  )
54
 
55
  const setQueryLabel = useCallback((newLabel: string) => {
lightrag_webui/src/hooks/useLightragGraph.tsx CHANGED
@@ -187,7 +187,7 @@ const useLightrangeGraph = () => {
187
  // Update previous parameters
188
  prevParamsRef.current = { queryLabel, maxQueryDepth, minDegree };
189
  }
190
- }, [queryLabel, maxQueryDepth, minDegree])
191
 
192
  const getNode = useCallback(
193
  (nodeId: string) => {
@@ -258,7 +258,7 @@ const useLightrangeGraph = () => {
258
  state.reset()
259
  state.setSigmaGraph(new DirectedGraph())
260
  }
261
- }, [queryLabel, maxQueryDepth, minDegree])
262
 
263
  const lightrageGraph = useCallback(() => {
264
  if (sigmaGraph) {
 
187
  // Update previous parameters
188
  prevParamsRef.current = { queryLabel, maxQueryDepth, minDegree };
189
  }
190
+ }, [queryLabel, maxQueryDepth, minDegree, isFetching])
191
 
192
  const getNode = useCallback(
193
  (nodeId: string) => {
 
258
  state.reset()
259
  state.setSigmaGraph(new DirectedGraph())
260
  }
261
+ }, [queryLabel, maxQueryDepth, minDegree, isFetching])
262
 
263
  const lightrageGraph = useCallback(() => {
264
  if (sigmaGraph) {