Improve segment adding logic

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-07-22 16:24:06 +05:30
parent ef17808fbd
commit 7530b28130

View file

@ -132,10 +132,12 @@ 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));
if (currentNavPath.get("details")?.value) { // Add right-panel segments from previous path
pushRightPanelSegment(segments, "details"); const previousSegments = currentNavPath.segments;
} else if (currentNavPath.get("members")?.value) { const i = previousSegments.findIndex(s => s.type === "right-panel");
pushRightPanelSegment(segments, "members"); if (i !== -1) {
segments.push(previousSegments[i]);
segments.push(previousSegments[i + 1]);
} }
} else if (type === "last-session") { } else if (type === "last-session") {
let sessionSegment = currentNavPath.get("session"); let sessionSegment = currentNavPath.get("session");