forked from mystiq/hydrogen-web
Keep memberlist until rightpanel is closed
- This should make switching between memberlist and member-details panel smoother for large rooms Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
16887c3c33
commit
d056a9f961
2 changed files with 6 additions and 3 deletions
|
@ -7,7 +7,6 @@ export class MemberListViewModel extends ViewModel {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
super(options);
|
super(options);
|
||||||
const list = options.members;
|
const list = options.members;
|
||||||
this.track(() => list.release());
|
|
||||||
|
|
||||||
const powerLevelsObservable = options.powerLevelsObservable;
|
const powerLevelsObservable = options.powerLevelsObservable;
|
||||||
this.track(powerLevelsObservable.subscribe(() => { /*resort based on new power levels here*/ }));
|
this.track(powerLevelsObservable.subscribe(() => { /*resort based on new power levels here*/ }));
|
||||||
|
|
|
@ -7,16 +7,20 @@ export class RightPanelViewModel extends ViewModel {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
super(options);
|
super(options);
|
||||||
this._room = options.room;
|
this._room = options.room;
|
||||||
|
this._members = null;
|
||||||
this._setupNavigation();
|
this._setupNavigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
get activeViewModel() { return this._activeViewModel; }
|
get activeViewModel() { return this._activeViewModel; }
|
||||||
|
|
||||||
async _getMemberListArguments() {
|
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 room = this._room;
|
||||||
const powerLevelsObservable = await this._room.observePowerLevels();
|
const powerLevelsObservable = await this._room.observePowerLevels();
|
||||||
return {members, powerLevelsObservable, mediaRepository: room.mediaRepository};
|
return {members: this._members, powerLevelsObservable, mediaRepository: room.mediaRepository};
|
||||||
}
|
}
|
||||||
|
|
||||||
async _getMemberDetailsArguments() {
|
async _getMemberDetailsArguments() {
|
||||||
|
|
Loading…
Reference in a new issue