use splice correctly after removing a local alias

pull/21833/head
Bruno Windels 2020-03-11 12:03:16 +01:00
parent 1ae4a1cd5b
commit 3baaaaab07
1 changed files with 1 additions and 1 deletions

View File

@ -235,7 +235,7 @@ export default class AliasSettings extends React.Component {
// to this room. See https://github.com/vector-im/riot-web/issues/7353
MatrixClientPeg.get().deleteAlias(alias).then(() => {
const localAliases = this.state.localAliases.slice();
localAliases.splice(index);
localAliases.splice(index, 1);
this.setState({localAliases});
if (this.state.canonicalAlias === alias) {