Skip to content

Commit

Permalink
fix bug with overriding patterns (#1298)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <[email protected]>

Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho authored Nov 28, 2022
1 parent 0ee5e1d commit 0fe1253
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import {
PPL_PATTERNS_DOCUMENTATION_URL,
PPL_STATS_REGEX,
} from '../../../../common/constants/shared';
import { GroupByChunk } from '../../../../common/query_manager/ast/types';
import {
IDefaultTimestampState,
IExplorerProps,
Expand Down Expand Up @@ -566,7 +565,7 @@ export const Explorer = ({
await updateQueryInStore(patternSelectQuery);
// Passing in empty string will remove pattern query
const patternErrorHandler = getErrorHandler('Error fetching patterns');
getPatterns(minInterval, patternErrorHandler);
getPatterns(selectedIntervalRef.current?.value.replace(/^auto_/, '') || 'y', patternErrorHandler);
}
};

Expand Down Expand Up @@ -641,7 +640,7 @@ export const Explorer = ({
getErrorHandler('Error overriding default pattern')
);
setIsOverridingPattern(false);
await getPatterns(minInterval, getErrorHandler('Error fetching patterns'));
await getPatterns(selectedIntervalRef.current?.value.replace(/^auto_/, '') || 'y', getErrorHandler('Error fetching patterns'));
};

const totalHits: number = useMemo(() => {
Expand Down Expand Up @@ -843,7 +842,7 @@ export const Explorer = ({
})
);
await getPatterns(
minInterval,
selectedIntervalRef.current?.value.replace(/^auto_/, '') || 'y',
getErrorHandler('Error fetching patterns')
);
}}
Expand Down

0 comments on commit 0fe1253

Please sign in to comment.