Always fetch data for "*" label
This commit is contained in:
@@ -64,7 +64,7 @@ const GraphLabels = () => {
|
|||||||
let result: string[] = labels
|
let result: string[] = labels
|
||||||
if (query) {
|
if (query) {
|
||||||
// Search labels
|
// Search labels
|
||||||
result = searchEngine.search(query).map((r) => labels[r.id])
|
result = searchEngine.search(query).map((r: { id: number }) => labels[r.id])
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.length <= labelListLimit
|
return result.length <= labelListLimit
|
||||||
|
@@ -186,9 +186,14 @@ const useLightrangeGraph = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (queryLabel) {
|
if (queryLabel) {
|
||||||
if (lastQueryLabel.label !== queryLabel ||
|
// Always fetch data for "*" label
|
||||||
|
// For other labels, only fetch when parameters change
|
||||||
|
const shouldUpdate = queryLabel === '*' ||
|
||||||
|
lastQueryLabel.label !== queryLabel ||
|
||||||
lastQueryLabel.maxQueryDepth !== maxQueryDepth ||
|
lastQueryLabel.maxQueryDepth !== maxQueryDepth ||
|
||||||
lastQueryLabel.minDegree !== minDegree) {
|
lastQueryLabel.minDegree !== minDegree;
|
||||||
|
|
||||||
|
if (shouldUpdate) {
|
||||||
lastQueryLabel.label = queryLabel
|
lastQueryLabel.label = queryLabel
|
||||||
lastQueryLabel.maxQueryDepth = maxQueryDepth
|
lastQueryLabel.maxQueryDepth = maxQueryDepth
|
||||||
lastQueryLabel.minDegree = minDegree
|
lastQueryLabel.minDegree = minDegree
|
||||||
|
Reference in New Issue
Block a user