don't open room view when clearing room id

This commit is contained in:
Bruno Windels 2021-05-11 13:10:21 +02:00
parent be7934057e
commit 9ea0138ffd

View file

@ -195,6 +195,12 @@ export class SessionViewModel extends ViewModel {
if (this._roomViewModelObservable) {
this._roomViewModelObservable = this.disposeTracked(this._roomViewModelObservable);
}
if (!roomId) {
// if clearing the activeMiddleViewModel rather than changing to a different one,
// emit so the view picks it up and show the placeholder
this.emitChange("activeMiddleViewModel");
return;
}
const vmo = new RoomViewModelObservable(this, roomId);
this._roomViewModelObservable = this.track(vmo);
// subscription is unsubscribed in RoomViewModelObservable.dispose, and thus handled by track