Merge pull request #4230 from matrix-org/bwindels/fixremovelocalaliaswithlag

Fix: ensure local state for aliases doesn't get garbled up
pull/21833/head
Bruno Windels 2020-03-18 10:36:57 +00:00 committed by GitHub
commit dcefcaf175
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -236,8 +236,7 @@ export default class AliasSettings extends React.Component {
// TODO: In future, we should probably be making sure that the alias actually belongs
// 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, 1);
const localAliases = this.state.localAliases.filter(a => a !== alias);
this.setState({localAliases});
if (this.state.canonicalAlias === alias) {