forked from mystiq/hydrogen-web
Improve segment adding logic
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
ef17808fbd
commit
7530b28130
1 changed files with 6 additions and 4 deletions
|
@ -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");
|
||||||
|
|
Loading…
Reference in a new issue