mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
fix room not changing when not in grid view
This commit is contained in:
parent
537972b97b
commit
46b24c3f24
@ -48,9 +48,9 @@ export class SessionViewModel extends ViewModel {
|
||||
this._sessionStatusViewModel.start();
|
||||
}
|
||||
|
||||
get middlePanelViewType() {
|
||||
get selectionId() {
|
||||
if (this._currentRoomViewModel) {
|
||||
return "room";
|
||||
return this._currentRoomViewModel._room.id;
|
||||
} else if (this._gridViewModel) {
|
||||
return "roomgrid";
|
||||
}
|
||||
|
@ -32,14 +32,14 @@ export class SessionView extends TemplateView {
|
||||
t.view(new SessionStatusView(vm.sessionStatusViewModel)),
|
||||
t.div({className: "main"}, [
|
||||
t.view(new LeftPanelView(vm.leftPanelViewModel)),
|
||||
t.mapView(vm => vm.middlePanelViewType, middlePanelViewType => {
|
||||
switch (middlePanelViewType) {
|
||||
case "room":
|
||||
return new RoomView(vm.currentRoom);
|
||||
t.mapView(vm => vm.selectionId, selectionId => {
|
||||
switch (selectionId) {
|
||||
case "roomgrid":
|
||||
return new RoomGridView(vm.roomGridViewModel);
|
||||
case "placeholder":
|
||||
return new RoomPlaceholderView();
|
||||
default: //room id
|
||||
return new RoomView(vm.currentRoom);
|
||||
}
|
||||
})
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user