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

View File

@ -47,7 +47,8 @@ export class MemberTileViewModel extends ViewModel {
} }
get detailsUrl() { 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) { _updatePreviousName(newName) {