From f841efeef41df77013ed0bf026a613fba0db238b Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 6 Sep 2021 12:41:17 +0530 Subject: [PATCH] Make check more generic Signed-off-by: RMidhunSuresh --- src/domain/navigation/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/domain/navigation/index.js b/src/domain/navigation/index.js index cf6e1d6f..821121b3 100644 --- a/src/domain/navigation/index.js +++ b/src/domain/navigation/index.js @@ -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");