Skip to content

Commit

Permalink
[ML] fix overall stats fetch with a saved search
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Feb 11, 2020
1 parent 62e3189 commit fb4c72a
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ export const Page: FC = () => {
}, [globalState?.refreshInterval?.pause, globalState?.refreshInterval?.value]);

const [lastRefresh, setLastRefresh] = useState(0);
useEffect(() => {
loadOverallStats();
}, [lastRefresh]);

useEffect(() => {
if (currentIndexPattern.timeFieldName !== undefined) {
Expand Down Expand Up @@ -227,11 +224,17 @@ export const Page: FC = () => {
setSearchString(qryString);
setSearchQueryLanguage(queryLanguage);
}
}, []);
}, [currentSavedSearch]);

useEffect(() => {
if (!!currentSavedSearch && searchQuery === defaultSearchQuery) {
// There is a saved search presented, but the search query has not been
// extracted yet.
return;
}

loadOverallStats();
}, [searchQuery, samplerShardSize]);
}, [searchQuery, currentSavedSearch, samplerShardSize, lastRefresh]);

useEffect(() => {
createMetricCards();
Expand Down

0 comments on commit fb4c72a

Please sign in to comment.