Modify open-room action to fix bug

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-08-18 17:43:40 +05:30
parent 1e05d41294
commit 7e177f6953
2 changed files with 10 additions and 6 deletions

View file

@ -132,12 +132,15 @@ export function parseUrlPath(urlPath, currentNavPath, defaultSessionId) {
segments.push(roomsSegmentWithRoom(rooms, roomId, currentNavPath));
}
segments.push(new Segment("room", roomId));
// Add right-panel segments from previous path
if (!urlPath.includes("/member/")) {
// Add right-panel segments from previous path if /member is not in url
// fixes memberlist -> member details closing/opening grid view
const previousSegments = currentNavPath.segments;
const i = previousSegments.findIndex(s => s.type === "right-panel");
if (i !== -1) {
segments.push(...previousSegments.slice(i));
}
}
} else if (type === "last-session") {
let sessionSegment = currentNavPath.get("session");
if (typeof sessionSegment?.value !== "string" && defaultSessionId) {

View file

@ -47,7 +47,8 @@ export class MemberTileViewModel extends ViewModel {
}
get detailsUrl() {
return `${this.urlCreator.urlUntilSegment("room")}/member/${this._member.userId}`;
const roomId = this.navigation.path.get("room").value;
return `${this.urlCreator.openRoomActionUrl(roomId)}/member/${this._member.userId}`;
}
_updatePreviousName(newName) {