From 7b9fb1b5e1932a3aa0a76300f60b96ba58970541 Mon Sep 17 00:00:00 2001 From: Phillip Burch Date: Wed, 15 Apr 2020 13:03:39 -0500 Subject: [PATCH] Because onThreshold is changed even when it hasn't changed add a check (#63555) (#63567) * Because onThreshold is changed even when it hasn't changed add a check * Fix join Co-authored-by: Elastic Machine --- .../infra/public/components/alerting/metrics/expression.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/infra/public/components/alerting/metrics/expression.tsx b/x-pack/plugins/infra/public/components/alerting/metrics/expression.tsx index 6cf4e5bed2e6f9..7de52840777f9c 100644 --- a/x-pack/plugins/infra/public/components/alerting/metrics/expression.tsx +++ b/x-pack/plugins/infra/public/components/alerting/metrics/expression.tsx @@ -399,7 +399,9 @@ export const ExpressionRow: React.FC = props => { const updateThreshold = useCallback( t => { - setAlertParams(expressionId, { ...expression, threshold: t }); + if (t.join() !== expression.threshold.join()) { + setAlertParams(expressionId, { ...expression, threshold: t }); + } }, [expressionId, expression, setAlertParams] );