decode ids separately, as we encode them separately as well

This commit is contained in:
Bruno Windels 2022-11-25 17:45:06 +01:00
parent b8444a32c0
commit 467a76c223

View File

@ -137,7 +137,7 @@ export function parseUrlPath(urlPath: string, currentNavPath: Path<SegmentType>,
if (type === "rooms") { if (type === "rooms") {
const roomsValue = iterator.next().value; const roomsValue = iterator.next().value;
if (roomsValue === undefined) { break; } if (roomsValue === undefined) { break; }
const roomIds = decodeURIComponent(roomsValue).split(","); const roomIds = roomsValue.split(",").map(id => decodeURIComponent(id));
segments.push(new Segment(type, roomIds)); segments.push(new Segment(type, roomIds));
const selectedIndex = parseInt(iterator.next().value || "0", 10); const selectedIndex = parseInt(iterator.next().value || "0", 10);
const roomId = roomIds[selectedIndex]; const roomId = roomIds[selectedIndex];