From ad5d7fc9f031c4613a036fcc96787b8fec23088c Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 21 Apr 2021 15:32:37 +0200 Subject: [PATCH] add note collection emit should happen first in Invite --- src/matrix/room/Invite.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/matrix/room/Invite.js b/src/matrix/room/Invite.js index 1335b46e..f9547828 100644 --- a/src/matrix/room/Invite.js +++ b/src/matrix/room/Invite.js @@ -149,6 +149,9 @@ export class Invite extends EventEmitter { } else { this._rejected = true; } + // important to remove before emitting change + // so code checking session.invites.get(id) won't + // find the invite anymore on update this._emitCollectionRemove(this); this.emit("change"); } else {