From f6d9ffa7bbcd7cc131803acefd9adc5b5f572eeb Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 7 Oct 2020 14:36:08 +0200 Subject: [PATCH] friends don't read each others private properties --- src/domain/session/SessionViewModel.js | 4 ++-- src/domain/session/room/RoomViewModel.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/domain/session/SessionViewModel.js b/src/domain/session/SessionViewModel.js index 5ad50600..beb35872 100644 --- a/src/domain/session/SessionViewModel.js +++ b/src/domain/session/SessionViewModel.js @@ -50,7 +50,7 @@ export class SessionViewModel extends ViewModel { get selectionId() { if (this._currentRoomViewModel) { - return this._currentRoomViewModel._room.id; + return this._currentRoomViewModel.id; } else if (this._gridViewModel) { return "roomgrid"; } @@ -111,7 +111,7 @@ export class SessionViewModel extends ViewModel { _openRoom(room, roomTileVM) { if (this._gridViewModel?.tryFocusRoom(room.id)) { return; - } else if (this._currentRoomViewModel?._room.id === room.id) { + } else if (this._currentRoomViewModel?.id === room.id) { return; } const roomVM = new RoomViewModel(this.childOptions({ diff --git a/src/domain/session/room/RoomViewModel.js b/src/domain/session/room/RoomViewModel.js index 87d0cb6c..7c8df7bc 100644 --- a/src/domain/session/room/RoomViewModel.js +++ b/src/domain/session/room/RoomViewModel.js @@ -98,6 +98,10 @@ export class RoomViewModel extends ViewModel { return this._room.name || this.i18n`Empty Room`; } + get id() { + return this._room.id; + } + get timelineViewModel() { return this._timelineVM; }