Make check more generic

Signed-off-by: RMidhunSuresh <hi@midhun.dev>
This commit is contained in:
RMidhunSuresh 2021-09-06 12:41:17 +05:30
parent 2ceaebbd1f
commit f841efeef4

View file

@ -132,8 +132,10 @@ export function parseUrlPath(urlPath, currentNavPath, defaultSessionId) {
segments.push(roomsSegmentWithRoom(rooms, roomId, currentNavPath));
}
segments.push(new Segment("room", roomId));
if (!urlPath.includes("/member/")) {
// Add right-panel segments from previous path if /member is not in url
const partIndex = parts.findIndex(part => part === "open-room");
const partsAfterRoom = parts.slice(partIndex + 1);
if (partsAfterRoom.length === 1) {
// Copy right-panel segments from previous path only if there are no other parts after open-room
// fixes memberlist -> member details closing/opening grid view
const previousSegments = currentNavPath.segments;
const i = previousSegments.findIndex(s => s.type === "right-panel");