Merge pull request #1203 from matrix-org/luke/fix-rte-user-completion

Fix bug where a received message would remove completions for users
This commit is contained in:
David Baker 2017-07-11 11:04:07 +01:00 committed by GitHub
commit 5c89d3303b

View file

@ -101,7 +101,8 @@ export default class UserProvider extends AutocompleteProvider {
onUserSpoke(user: RoomMember) { onUserSpoke(user: RoomMember) {
if(user.userId === MatrixClientPeg.get().credentials.userId) return; if(user.userId === MatrixClientPeg.get().credentials.userId) return;
this.users = this.users.splice( // Move the user that spoke to the front of the array
this.users.splice(
this.users.findIndex((user2) => user2.userId === user.userId), 1); this.users.findIndex((user2) => user2.userId === user.userId), 1);
this.users = [user, ...this.users]; this.users = [user, ...this.users];