Move variable to scope of conditional

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-06-04 18:37:32 +05:30
parent 7fbcf89539
commit 332fbdda84

View file

@ -258,9 +258,9 @@ export class SessionViewModel extends ViewModel {
_toggleRoomInformationPanel() { _toggleRoomInformationPanel() {
this._roomInfoViewModel = this.disposeTracked(this._roomInfoViewModel); this._roomInfoViewModel = this.disposeTracked(this._roomInfoViewModel);
const room = this._roomFromNavigation();
const enable = !!this.navigation.path.get("details")?.value; const enable = !!this.navigation.path.get("details")?.value;
if (enable) { if (enable) {
const room = this._roomFromNavigation();
this._roomInfoViewModel = this.track(new RoomInfoViewModel(this.childOptions({ room }))); this._roomInfoViewModel = this.track(new RoomInfoViewModel(this.childOptions({ room })));
} }
this.emitChange("roomInfoViewModel"); this.emitChange("roomInfoViewModel");