Remove array from logic

Signed-off-by: RMidhunSuresh <hi@midhun.dev>
This commit is contained in:
RMidhunSuresh 2021-09-06 17:41:36 +05:30
parent 4f4bc8f805
commit df74d0c814

View File

@ -132,9 +132,9 @@ 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));
const partIndex = parts.findIndex(part => part === "open-room"); const openRoomPartIndex = parts.findIndex(part => part === "open-room");
const partsAfterRoom = parts.slice(partIndex + 1); const hasOnlyRoomIdAfterPart = openRoomPartIndex >= parts.length - 2;
if (partsAfterRoom.length === 1) { if (hasOnlyRoomIdAfterPart) {
// Copy right-panel segments from previous path only if there are no other parts after open-room // 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 // fixes memberlist -> member details closing/opening grid view
const previousSegments = currentNavPath.segments; const previousSegments = currentNavPath.segments;