From 309d2e7c96c10f251139ac8f1d8d4dfc32e29cfc Mon Sep 17 00:00:00 2001 From: Timo K Date: Mon, 2 Oct 2023 21:31:24 +0200 Subject: [PATCH] make sure roomAlias = null in widget mode Signed-off-by: Timo K --- src/UrlParams.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/UrlParams.ts b/src/UrlParams.ts index 90713c3b..645c3853 100644 --- a/src/UrlParams.ts +++ b/src/UrlParams.ts @@ -224,8 +224,12 @@ export function getRoomIdentifierFromUrl( roomAlias = pathname.substring(1); // Strip the "/" // Delete "/room/", if present - if (roomAlias.startsWith("room/")) { - roomAlias = roomAlias.substring("room/".length); + if (roomAlias.startsWith("room")) { + roomAlias = roomAlias.substring("room".length); + } + // We separate `room` and `/` because in widget mode we use room without providing an alias `.../room#?...` + if (roomAlias.startsWith("/")) { + roomAlias = roomAlias.substring("/".length); } // Add "#", if not present if (!roomAlias.startsWith("#")) {