Skip to content

Commit 983fd65

Browse files
Merge pull request #221 from alanconway/fix-stored-result
COO-1383: fix: Restore fix for disappearing graph.
2 parents 0e1b874 + cc369cd commit 983fd65

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

web/src/components/Korrel8rPanel.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,15 @@ export default function Korrel8rPanel() {
7777
dispatchSearch({ ...defaultSearch, queryStr: locationQuery.toString() });
7878
}, [locationQuery, dispatchSearch, search?.queryStr]);
7979

80+
// Skip the first fetch if we already have a stored result.
81+
const useStoredResult = React.useRef(result != null);
82+
8083
// Fetch a new result from the korrel8r service when the search changes.
8184
React.useEffect(() => {
85+
if (useStoredResult.current) {
86+
useStoredResult.current = false; // Fetch a new result next time.
87+
return;
88+
}
8289
const queryStr = search?.queryStr;
8390
if (!queryStr) {
8491
dispatchResult({ title: t('Empty Query'), message: t('No starting point for correlation') });

0 commit comments

Comments
 (0)