fix room not changing when not in grid view

This commit is contained in:
Bruno Windels 2020-10-07 14:32:57 +02:00
parent 537972b97b
commit 46b24c3f24
2 changed files with 6 additions and 6 deletions

View File

@ -48,9 +48,9 @@ export class SessionViewModel extends ViewModel {
this._sessionStatusViewModel.start(); this._sessionStatusViewModel.start();
} }
get middlePanelViewType() { get selectionId() {
if (this._currentRoomViewModel) { if (this._currentRoomViewModel) {
return "room"; return this._currentRoomViewModel._room.id;
} else if (this._gridViewModel) { } else if (this._gridViewModel) {
return "roomgrid"; return "roomgrid";
} }

View File

@ -32,14 +32,14 @@ export class SessionView extends TemplateView {
t.view(new SessionStatusView(vm.sessionStatusViewModel)), t.view(new SessionStatusView(vm.sessionStatusViewModel)),
t.div({className: "main"}, [ t.div({className: "main"}, [
t.view(new LeftPanelView(vm.leftPanelViewModel)), t.view(new LeftPanelView(vm.leftPanelViewModel)),
t.mapView(vm => vm.middlePanelViewType, middlePanelViewType => { t.mapView(vm => vm.selectionId, selectionId => {
switch (middlePanelViewType) { switch (selectionId) {
case "room":
return new RoomView(vm.currentRoom);
case "roomgrid": case "roomgrid":
return new RoomGridView(vm.roomGridViewModel); return new RoomGridView(vm.roomGridViewModel);
case "placeholder": case "placeholder":
return new RoomPlaceholderView(); return new RoomPlaceholderView();
default: //room id
return new RoomView(vm.currentRoom);
} }
}) })
]) ])