mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-10 20:17:32 +01:00
don't open room view when clearing room id
This commit is contained in:
parent
be7934057e
commit
9ea0138ffd
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user