From 46b24c3f24a33e91dd2781b1a347ccbf2fba3099 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 7 Oct 2020 14:32:57 +0200 Subject: [PATCH] fix room not changing when not in grid view --- src/domain/session/SessionViewModel.js | 4 ++-- src/ui/web/session/SessionView.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/domain/session/SessionViewModel.js b/src/domain/session/SessionViewModel.js index 076d8178..5ad50600 100644 --- a/src/domain/session/SessionViewModel.js +++ b/src/domain/session/SessionViewModel.js @@ -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"; } diff --git a/src/ui/web/session/SessionView.js b/src/ui/web/session/SessionView.js index 63fe819d..aaeecc5c 100644 --- a/src/ui/web/session/SessionView.js +++ b/src/ui/web/session/SessionView.js @@ -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); } }) ])