Subscribe to powerLevels

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-07-15 17:19:27 +05:30
parent 960f2c283e
commit 60793798c7

View file

@ -8,8 +8,11 @@ export class MemberListViewModel extends ViewModel {
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
const powerLevelsObservable = options.powerLevelsObservable;
this.track(powerLevelsObservable.subscribe(() => { /*resort based on new power levels here*/ }));
const powerLevels = powerLevelsObservable.get();
this.memberTileViewModels = this._mapTileViewModels(this._filterJoinedMembers(list.members))
.sortValues(createMemberComparator(powerLevels));
this.nameDisambiguator = new Disambiguator();