Skip to content

Commit

Permalink
Merge pull request #2433 from matrix-org/travis/rver/7992
Browse files Browse the repository at this point in the history
Recalculate the visible rooms when rooms are upgraded
  • Loading branch information
dbkr committed Jan 11, 2019
2 parents 93cf281 + 7d4b6ad commit e0bc049
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/views/rooms/RoomList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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();
},
Expand Down

0 comments on commit e0bc049

Please sign in to comment.