1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-22 04:02:40 +03:00

Merge pull request #2433 from matrix-org/travis/rver/7992

Recalculate the visible rooms when rooms are upgraded
This commit is contained in:
David Baker
2019-01-11 10:37:32 +00:00
committed by GitHub

View File

@@ -102,6 +102,7 @@ module.exports = React.createClass({
cli.on("Event.decrypted", this.onEventDecrypted); cli.on("Event.decrypted", this.onEventDecrypted);
cli.on("accountData", this.onAccountData); cli.on("accountData", this.onAccountData);
cli.on("Group.myMembership", this._onGroupMyMembership); cli.on("Group.myMembership", this._onGroupMyMembership);
cli.on("RoomState.events", this.onRoomStateEvents);
const dmRoomMap = DMRoomMap.shared(); const dmRoomMap = DMRoomMap.shared();
// A map between tags which are group IDs and the room IDs of rooms that should be kept // 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("Event.decrypted", this.onEventDecrypted);
MatrixClientPeg.get().removeListener("accountData", this.onAccountData); MatrixClientPeg.get().removeListener("accountData", this.onAccountData);
MatrixClientPeg.get().removeListener("Group.myMembership", this._onGroupMyMembership); MatrixClientPeg.get().removeListener("Group.myMembership", this._onGroupMyMembership);
MatrixClientPeg.get().removeListener("RoomState.events", this.onRoomStateEvents);
} }
if (this._tagStoreToken) { if (this._tagStoreToken) {
@@ -249,6 +251,12 @@ module.exports = React.createClass({
this.updateVisibleRooms(); this.updateVisibleRooms();
}, },
onRoomStateEvents: function(ev, state) {
if (ev.getType() === "m.room.create" || ev.getType() === "m.room.tombstone") {
this.updateVisibleRooms();
}
},
onDeleteRoom: function(roomId) { onDeleteRoom: function(roomId) {
this.updateVisibleRooms(); this.updateVisibleRooms();
}, },