From 62f767126dd3e691461ec64dbfc530082c7809e9 Mon Sep 17 00:00:00 2001 From: deniz kusefoglu Date: Fri, 1 Dec 2017 12:42:37 -0800 Subject: [PATCH] Update handler fields without reordering them --- ui/src/kapacitor/components/RuleHandlers.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/src/kapacitor/components/RuleHandlers.js b/ui/src/kapacitor/components/RuleHandlers.js index 0126ff7962..6744b79ff9 100644 --- a/ui/src/kapacitor/components/RuleHandlers.js +++ b/ui/src/kapacitor/components/RuleHandlers.js @@ -106,14 +106,17 @@ class RuleHandlers extends Component { } } - const remainingEndpoints = _.reject(handlersOnThisAlert, [ + const modifiedIndex = _.findIndex(handlersOnThisAlert, [ 'alias', modifiedEP.alias, ]) + + handlersOnThisAlert[modifiedIndex] = modifiedEP + this.setState( { selectedHandler: modifiedEP, - handlersOnThisAlert: [...remainingEndpoints, modifiedEP], + handlersOnThisAlert: [...handlersOnThisAlert], }, this.handleUpdateAllAlerts )