Skip to content

Commit

Permalink
Check for property first
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry350 committed Jun 18, 2021
1 parent b15c6b2 commit 1f76eea
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ export const Editor: React.FC<

const shouldShowGroupByOptimizationWarning = useMemo(() => {
const hasSetGroupBy = alertParams.groupBy && alertParams.groupBy.length > 0;
const hasSetOptimizableThresholdComparator = alertParams.count.comparator === Comparator.GT;
const hasSetOptimizableThresholdComparator =
alertParams.count && alertParams.count.comparator === Comparator.GT;
return hasSetGroupBy && !hasSetOptimizableThresholdComparator;
}, [alertParams]);

Expand Down

0 comments on commit 1f76eea

Please sign in to comment.