diff --git a/src/frontend/src/features/home/components/JoinMeetingDialog.tsx b/src/frontend/src/features/home/components/JoinMeetingDialog.tsx index fc2f5d45..283fc8c1 100644 --- a/src/frontend/src/features/home/components/JoinMeetingDialog.tsx +++ b/src/frontend/src/features/home/components/JoinMeetingDialog.tsx @@ -9,7 +9,12 @@ export const JoinMeetingDialog = () => {
{ - navigateTo('room', data.roomId as string) + navigateTo( + 'room', + (data.roomId as string) + .trim() + .replace(`${window.location.origin}/`, '') + ) }} submitLabel={t('joinInputSubmit')} > diff --git a/src/frontend/src/features/rooms/utils/isRoomValid.ts b/src/frontend/src/features/rooms/utils/isRoomValid.ts index 12fc3d04..a6100d61 100644 --- a/src/frontend/src/features/rooms/utils/isRoomValid.ts +++ b/src/frontend/src/features/rooms/utils/isRoomValid.ts @@ -1,4 +1,5 @@ export const roomIdPattern = '[a-z]{3}-[a-z]{4}-[a-z]{3}' -export const isRoomValid = (roomId: string) => - new RegExp(`^${roomIdPattern}$`).test(roomId) +export const isRoomValid = (roomIdOrUrl: string) => + new RegExp(`^${roomIdPattern}$`).test(roomIdOrUrl) || + new RegExp(`^${window.location.origin}/${roomIdPattern}$`).test(roomIdOrUrl)