Update handler fields without reordering them

pull/10616/head
deniz kusefoglu 2017-12-01 12:42:37 -08:00
parent bd5165b6d2
commit 62f767126d
1 changed files with 5 additions and 2 deletions

View File

@ -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
)