Remove redundant label fetch on mount

This commit is contained in:
yangdx
2025-03-13 13:00:03 +08:00
parent 002d675dc6
commit 20b8a9d7e9

View File

@@ -169,11 +169,6 @@ const useLightrangeGraph = () => {
const minDegree = useSettingsStore.use.graphMinDegree() const minDegree = useSettingsStore.use.graphMinDegree()
const isFetching = useGraphStore.use.isFetching() const isFetching = useGraphStore.use.isFetching()
// Fetch all database labels on mount
useEffect(() => {
useGraphStore.getState().fetchAllDatabaseLabels()
}, [])
// Use ref to track fetch status // Use ref to track fetch status
const fetchStatusRef = useRef<Record<string, boolean>>({}); const fetchStatusRef = useRef<Record<string, boolean>>({});
@@ -276,6 +271,7 @@ const useLightrangeGraph = () => {
const state = useGraphStore.getState() const state = useGraphStore.getState()
state.reset() state.reset()
state.setSigmaGraph(new DirectedGraph()) state.setSigmaGraph(new DirectedGraph())
state.setGraphLabels(['*'])
} }
}, [queryLabel, maxQueryDepth, minDegree, isFetching]) }, [queryLabel, maxQueryDepth, minDegree, isFetching])