mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-11 12:37:22 +01:00
Extract method
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
ddaa9b46c0
commit
c3333f5fe8
@ -241,8 +241,7 @@ export class SessionViewModel extends ViewModel {
|
|||||||
this._lightboxViewModel = this.disposeTracked(this._lightboxViewModel);
|
this._lightboxViewModel = this.disposeTracked(this._lightboxViewModel);
|
||||||
}
|
}
|
||||||
if (eventId) {
|
if (eventId) {
|
||||||
const roomId = this.navigation.path.get("room").value;
|
const room = this._roomFromNavigation();
|
||||||
const room = this._sessionContainer.session.rooms.get(roomId);
|
|
||||||
this._lightboxViewModel = this.track(new LightboxViewModel(this.childOptions({eventId, room})));
|
this._lightboxViewModel = this.track(new LightboxViewModel(this.childOptions({eventId, room})));
|
||||||
}
|
}
|
||||||
this.emitChange("lightboxViewModel");
|
this.emitChange("lightboxViewModel");
|
||||||
@ -252,10 +251,15 @@ export class SessionViewModel extends ViewModel {
|
|||||||
return this._lightboxViewModel;
|
return this._lightboxViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
_toggleRoomInformationPanel() {
|
_roomFromNavigation() {
|
||||||
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);
|
||||||
|
return room;
|
||||||
|
}
|
||||||
|
|
||||||
|
_toggleRoomInformationPanel() {
|
||||||
|
this._roomInfoViewModel = this.disposeTracked(this._roomInfoViewModel);
|
||||||
|
const room = this._roomFromNavigation();
|
||||||
if (!room) {
|
if (!room) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user