mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
Dispose vm preemptively
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
7e38c3ea88
commit
ddaa9b46c0
@ -253,15 +253,16 @@ export class SessionViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_toggleRoomInformationPanel() {
|
_toggleRoomInformationPanel() {
|
||||||
|
this._roomInfoViewModel = this.disposeTracked(this._roomInfoViewModel);
|
||||||
const roomId = this.navigation.path.get("room")?.value;
|
const roomId = this.navigation.path.get("room")?.value;
|
||||||
const room = this._sessionContainer.session.rooms.get(roomId);
|
const room = this._sessionContainer.session.rooms.get(roomId);
|
||||||
const enable = !!this.navigation.path.get("details");
|
|
||||||
if (!room) {
|
if (!room) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._roomInfoViewModel = enable ?
|
const enable = !!this.navigation.path.get("details");
|
||||||
this.track(new RoomInfoViewModel(this.childOptions({ room }))) :
|
if (enable) {
|
||||||
this.disposeTracked(this._roomInfoViewModel);
|
this._roomInfoViewModel = this.track(new RoomInfoViewModel(this.childOptions({ room })));
|
||||||
|
}
|
||||||
this.emitChange("roomInfoViewModel");
|
this.emitChange("roomInfoViewModel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user