yangdx commited on
Commit
85b7cce
·
1 Parent(s): a4ac433

Always fetch data for "*" label

Browse files
lightrag_webui/src/components/graph/GraphLabels.tsx CHANGED
@@ -64,7 +64,7 @@ const GraphLabels = () => {
64
  let result: string[] = labels
65
  if (query) {
66
  // Search labels
67
- result = searchEngine.search(query).map((r) => labels[r.id])
68
  }
69
 
70
  return result.length <= labelListLimit
 
64
  let result: string[] = labels
65
  if (query) {
66
  // Search labels
67
+ result = searchEngine.search(query).map((r: { id: number }) => labels[r.id])
68
  }
69
 
70
  return result.length <= labelListLimit
lightrag_webui/src/hooks/useLightragGraph.tsx CHANGED
@@ -186,9 +186,14 @@ const useLightrangeGraph = () => {
186
 
187
  useEffect(() => {
188
  if (queryLabel) {
189
- if (lastQueryLabel.label !== queryLabel ||
190
- lastQueryLabel.maxQueryDepth !== maxQueryDepth ||
191
- lastQueryLabel.minDegree !== minDegree) {
 
 
 
 
 
192
  lastQueryLabel.label = queryLabel
193
  lastQueryLabel.maxQueryDepth = maxQueryDepth
194
  lastQueryLabel.minDegree = minDegree
 
186
 
187
  useEffect(() => {
188
  if (queryLabel) {
189
+ // Always fetch data for "*" label
190
+ // For other labels, only fetch when parameters change
191
+ const shouldUpdate = queryLabel === '*' ||
192
+ lastQueryLabel.label !== queryLabel ||
193
+ lastQueryLabel.maxQueryDepth !== maxQueryDepth ||
194
+ lastQueryLabel.minDegree !== minDegree;
195
+
196
+ if (shouldUpdate) {
197
  lastQueryLabel.label = queryLabel
198
  lastQueryLabel.maxQueryDepth = maxQueryDepth
199
  lastQueryLabel.minDegree = minDegree