forked from mystiq/hydrogen-web
fix room not changing when not in grid view
This commit is contained in:
parent
537972b97b
commit
46b24c3f24
2 changed files with 6 additions and 6 deletions
|
@ -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 a new issue