Release memberlist after panel is closed

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-07-15 16:49:30 +05:30
parent 5a54be2e2e
commit 5873ab63ba
2 changed files with 5 additions and 3 deletions

View file

@ -6,9 +6,11 @@ import {Disambiguator} from "./disambiguator.js";
export class MemberListViewModel extends ViewModel {
constructor(options) {
super(options);
const list = options.members;
this.track(() => list.release());
const powerLevels = options.powerLevelsObservable.get();
// We should subscribe to the observable here so that we can resort when pl changes
this.memberTileViewModels = this._mapTileViewModels(this._filterJoinedMembers(options.members))
this.memberTileViewModels = this._mapTileViewModels(this._filterJoinedMembers(list.members))
.sortValues(createMemberComparator(powerLevels));
this.nameDisambiguator = new Disambiguator();
this.mediaRepository = options.mediaRepository;

View file

@ -12,10 +12,10 @@ export class RightPanelViewModel extends ViewModel {
get activeViewModel() { return this._activeViewModel; }
async _getMemberArguments() {
const list = await this._room.loadMemberList();
const members = await this._room.loadMemberList();
const room = this._room;
const powerLevelsObservable = await this._room.observePowerLevels();
return {members: list.members, powerLevelsObservable, mediaRepository: room.mediaRepository};
return {members, powerLevelsObservable, mediaRepository: room.mediaRepository};
}
_setupNavigation() {