mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-25 19:51:39 +01:00
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
@ -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");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user