No need to pass in roomId

Signed-off-by: RMidhunSuresh <hi@midhun.dev>
This commit is contained in:
RMidhunSuresh 2021-09-06 12:59:30 +05:30
parent f841efeef4
commit a54413625e
3 changed files with 4 additions and 5 deletions

View file

@ -23,7 +23,6 @@ export class MemberListViewModel extends ViewModel {
constructor(options) { constructor(options) {
super(options); super(options);
const list = options.members; const list = options.members;
this._roomId = options.roomId;
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*/ }));
@ -44,7 +43,7 @@ export class MemberListViewModel extends ViewModel {
_mapTileViewModels(members) { _mapTileViewModels(members) {
const mapper = (member, emitChange) => { const mapper = (member, emitChange) => {
const mediaRepository = this.mediaRepository; const mediaRepository = this.mediaRepository;
const vm = new MemberTileViewModel(this.childOptions({member, emitChange, mediaRepository, roomId: this._roomId})); const vm = new MemberTileViewModel(this.childOptions({member, emitChange, mediaRepository}));
this.nameDisambiguator.disambiguate(vm); this.nameDisambiguator.disambiguate(vm);
return vm; return vm;
} }

View file

@ -24,7 +24,6 @@ export class MemberTileViewModel extends ViewModel {
this._mediaRepository = options.mediaRepository this._mediaRepository = options.mediaRepository
this._previousName = null; this._previousName = null;
this._nameChanged = true; this._nameChanged = true;
this._roomId = options.roomId;
} }
get name() { get name() {
@ -48,7 +47,8 @@ export class MemberTileViewModel extends ViewModel {
} }
get detailsUrl() { get detailsUrl() {
return `${this.urlCreator.openRoomActionUrl(this._roomId)}/member/${this._member.userId}`; const roomId = this.navigation.path.get("room").value;
return `${this.urlCreator.openRoomActionUrl(roomId)}/member/${this._member.userId}`;
} }
_updatePreviousName(newName) { _updatePreviousName(newName) {

View file

@ -36,7 +36,7 @@ export class RightPanelViewModel extends ViewModel {
} }
const room = this._room; const room = this._room;
const powerLevelsObservable = await this._room.observePowerLevels(); const powerLevelsObservable = await this._room.observePowerLevels();
return {members: this._members, powerLevelsObservable, mediaRepository: room.mediaRepository, roomId: this._room.id}; return {members: this._members, powerLevelsObservable, mediaRepository: room.mediaRepository};
} }
async _getMemberDetailsArguments() { async _getMemberDetailsArguments() {