also unset room vm if moving away from room

This commit is contained in:
Bruno Windels 2020-10-13 13:12:49 +02:00
parent 379d65edf1
commit a360d0a2b9

View File

@ -142,6 +142,13 @@ export class SessionViewModel extends ViewModel {
}
_openRoom(roomId) {
if (!roomId) {
if (this._currentRoomViewModel) {
this._currentRoomViewModel = this.disposeTracked(this._currentRoomViewModel);
this.emitChange("currentRoom");
}
return;
}
// already open?
if (this._currentRoomViewModel?.id === roomId) {
return;