From 7d4b6add2cfd3d71dd093b55be90248414050b7a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 10 Jan 2019 15:43:22 -0700 Subject: [PATCH] Recalculate the visible rooms when rooms are upgraded We also do this when they are created just in case we missed the tombstone event. Fixes https://github.com/vector-im/riot-web/issues/7992 --- src/components/views/rooms/RoomList.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index dbfe95dadf..ed8142cd53 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -102,6 +102,7 @@ module.exports = React.createClass({ cli.on("Event.decrypted", this.onEventDecrypted); cli.on("accountData", this.onAccountData); cli.on("Group.myMembership", this._onGroupMyMembership); + cli.on("RoomState.events", this.onRoomStateEvents); const dmRoomMap = DMRoomMap.shared(); // A map between tags which are group IDs and the room IDs of rooms that should be kept @@ -226,6 +227,7 @@ module.exports = React.createClass({ MatrixClientPeg.get().removeListener("Event.decrypted", this.onEventDecrypted); MatrixClientPeg.get().removeListener("accountData", this.onAccountData); MatrixClientPeg.get().removeListener("Group.myMembership", this._onGroupMyMembership); + MatrixClientPeg.get().removeListener("RoomState.events", this.onRoomStateEvents); } if (this._tagStoreToken) { @@ -249,6 +251,12 @@ module.exports = React.createClass({ this.updateVisibleRooms(); }, + onRoomStateEvents: function(ev, state) { + if (ev.getType() === "m.room.create" || ev.getType() === "m.room.tombstone") { + this.updateVisibleRooms(); + } + }, + onDeleteRoom: function(roomId) { this.updateVisibleRooms(); },