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(new Segment("room", roomId));
|
||||
if (currentNavPath.get("details")?.value) {
|
||||
pushRightPanelSegment(segments, "details");
|
||||
} else if (currentNavPath.get("members")?.value) {
|
||||
pushRightPanelSegment(segments, "members");
|
||||
// Add right-panel segments from previous path
|
||||
const previousSegments = currentNavPath.segments;
|
||||
const i = previousSegments.findIndex(s => s.type === "right-panel");
|
||||
if (i !== -1) {
|
||||
segments.push(previousSegments[i]);
|
||||
segments.push(previousSegments[i + 1]);
|
||||
}
|
||||
} else if (type === "last-session") {
|
||||
let sessionSegment = currentNavPath.get("session");
|
||||
|
|
Loading…
Reference in a new issue