From d056a9f961835da5ff769cd5d1e3e06a1e7e9e72 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Thu, 22 Jul 2021 20:33:27 +0530 Subject: [PATCH] Keep memberlist until rightpanel is closed - This should make switching between memberlist and member-details panel smoother for large rooms Signed-off-by: RMidhunSuresh --- src/domain/session/rightpanel/MemberListViewModel.js | 1 - src/domain/session/rightpanel/RightPanelViewModel.js | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/domain/session/rightpanel/MemberListViewModel.js b/src/domain/session/rightpanel/MemberListViewModel.js index ce0fff40..a6f58f5d 100644 --- a/src/domain/session/rightpanel/MemberListViewModel.js +++ b/src/domain/session/rightpanel/MemberListViewModel.js @@ -7,7 +7,6 @@ export class MemberListViewModel extends ViewModel { constructor(options) { super(options); const list = options.members; - this.track(() => list.release()); const powerLevelsObservable = options.powerLevelsObservable; this.track(powerLevelsObservable.subscribe(() => { /*resort based on new power levels here*/ })); diff --git a/src/domain/session/rightpanel/RightPanelViewModel.js b/src/domain/session/rightpanel/RightPanelViewModel.js index 5564fd8d..86225ca9 100644 --- a/src/domain/session/rightpanel/RightPanelViewModel.js +++ b/src/domain/session/rightpanel/RightPanelViewModel.js @@ -7,16 +7,20 @@ export class RightPanelViewModel extends ViewModel { constructor(options) { super(options); this._room = options.room; + this._members = null; this._setupNavigation(); } get activeViewModel() { return this._activeViewModel; } async _getMemberListArguments() { - const members = await this._room.loadMemberList(); + if (!this._members) { + this._members = await this._room.loadMemberList(); + this.track(() => this._members.release()); + } const room = this._room; const powerLevelsObservable = await this._room.observePowerLevels(); - return {members, powerLevelsObservable, mediaRepository: room.mediaRepository}; + return {members: this._members, powerLevelsObservable, mediaRepository: room.mediaRepository}; } async _getMemberDetailsArguments() {