mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Don't find roomId in getter
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
7e177f6953
commit
2ceaebbd1f
@ -23,6 +23,7 @@ export class MemberListViewModel extends ViewModel {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
const list = options.members;
|
||||
this._roomId = options.roomId;
|
||||
|
||||
const powerLevelsObservable = options.powerLevelsObservable;
|
||||
this.track(powerLevelsObservable.subscribe(() => { /*resort based on new power levels here*/ }));
|
||||
@ -43,7 +44,7 @@ export class MemberListViewModel extends ViewModel {
|
||||
_mapTileViewModels(members) {
|
||||
const mapper = (member, emitChange) => {
|
||||
const mediaRepository = this.mediaRepository;
|
||||
const vm = new MemberTileViewModel(this.childOptions({member, emitChange, mediaRepository}));
|
||||
const vm = new MemberTileViewModel(this.childOptions({member, emitChange, mediaRepository, roomId: this._roomId}));
|
||||
this.nameDisambiguator.disambiguate(vm);
|
||||
return vm;
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ export class MemberTileViewModel extends ViewModel {
|
||||
this._mediaRepository = options.mediaRepository
|
||||
this._previousName = null;
|
||||
this._nameChanged = true;
|
||||
this._roomId = options.roomId;
|
||||
}
|
||||
|
||||
get name() {
|
||||
@ -47,8 +48,7 @@ export class MemberTileViewModel extends ViewModel {
|
||||
}
|
||||
|
||||
get detailsUrl() {
|
||||
const roomId = this.navigation.path.get("room").value;
|
||||
return `${this.urlCreator.openRoomActionUrl(roomId)}/member/${this._member.userId}`;
|
||||
return `${this.urlCreator.openRoomActionUrl(this._roomId)}/member/${this._member.userId}`;
|
||||
}
|
||||
|
||||
_updatePreviousName(newName) {
|
||||
|
@ -36,7 +36,7 @@ export class RightPanelViewModel extends ViewModel {
|
||||
}
|
||||
const room = this._room;
|
||||
const powerLevelsObservable = await this._room.observePowerLevels();
|
||||
return {members: this._members, powerLevelsObservable, mediaRepository: room.mediaRepository};
|
||||
return {members: this._members, powerLevelsObservable, mediaRepository: room.mediaRepository, roomId: this._room.id};
|
||||
}
|
||||
|
||||
async _getMemberDetailsArguments() {
|
||||
|
Loading…
Reference in New Issue
Block a user