From a54413625e0ac05554214dff6820c783c8ca1795 Mon Sep 17 00:00:00 2001
From: RMidhunSuresh <hi@midhun.dev>
Date: Mon, 6 Sep 2021 12:59:30 +0530
Subject: [PATCH] No need to pass in roomId

Signed-off-by: RMidhunSuresh <hi@midhun.dev>
---
 src/domain/session/rightpanel/MemberListViewModel.js | 3 +--
 src/domain/session/rightpanel/MemberTileViewModel.js | 4 ++--
 src/domain/session/rightpanel/RightPanelViewModel.js | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/domain/session/rightpanel/MemberListViewModel.js b/src/domain/session/rightpanel/MemberListViewModel.js
index 664507ff..5b8bb83e 100644
--- a/src/domain/session/rightpanel/MemberListViewModel.js
+++ b/src/domain/session/rightpanel/MemberListViewModel.js
@@ -23,7 +23,6 @@ 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*/ }));
@@ -44,7 +43,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, roomId: this._roomId}));
+            const vm = new MemberTileViewModel(this.childOptions({member, emitChange, mediaRepository}));
             this.nameDisambiguator.disambiguate(vm);
             return vm;
         }
diff --git a/src/domain/session/rightpanel/MemberTileViewModel.js b/src/domain/session/rightpanel/MemberTileViewModel.js
index c9e460b2..eac6a6d4 100644
--- a/src/domain/session/rightpanel/MemberTileViewModel.js
+++ b/src/domain/session/rightpanel/MemberTileViewModel.js
@@ -24,7 +24,6 @@ export class MemberTileViewModel extends ViewModel {
         this._mediaRepository = options.mediaRepository
         this._previousName = null;
         this._nameChanged = true;
-        this._roomId = options.roomId;
     }
 
     get name() {
@@ -48,7 +47,8 @@ export class MemberTileViewModel extends ViewModel {
     }
 
     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) {
diff --git a/src/domain/session/rightpanel/RightPanelViewModel.js b/src/domain/session/rightpanel/RightPanelViewModel.js
index c66f1755..670df868 100644
--- a/src/domain/session/rightpanel/RightPanelViewModel.js
+++ b/src/domain/session/rightpanel/RightPanelViewModel.js
@@ -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, roomId: this._room.id};
+        return {members: this._members, powerLevelsObservable, mediaRepository: room.mediaRepository};
     }
 
     async _getMemberDetailsArguments() {