Make sure room does exist before creating vm
- This will stop the code from throwing when opening /details on UnknownRoomView. Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
a273b25bac
commit
eb35f46214
1 changed files with 1 additions and 0 deletions
|
@ -261,6 +261,7 @@ export class SessionViewModel extends ViewModel {
|
||||||
const enable = !!this.navigation.path.get("details")?.value;
|
const enable = !!this.navigation.path.get("details")?.value;
|
||||||
if (enable) {
|
if (enable) {
|
||||||
const room = this._roomFromNavigation();
|
const room = this._roomFromNavigation();
|
||||||
|
if (!room) { return; }
|
||||||
this._roomDetailsViewModel = this.track(new RoomDetailsViewModel(this.childOptions({room})));
|
this._roomDetailsViewModel = this.track(new RoomDetailsViewModel(this.childOptions({room})));
|
||||||
}
|
}
|
||||||
this.emitChange("roomDetailsViewModel");
|
this.emitChange("roomDetailsViewModel");
|
||||||
|
|
Reference in a new issue