🐛(home) fix invite form that didn't work with actual meeting urls
it worked with codes but not full urls!
This commit is contained in:
@@ -9,7 +9,12 @@ export const JoinMeetingDialog = () => {
|
||||
<Dialog title={t('joinMeeting')}>
|
||||
<Form
|
||||
onSubmit={(data) => {
|
||||
navigateTo('room', data.roomId as string)
|
||||
navigateTo(
|
||||
'room',
|
||||
(data.roomId as string)
|
||||
.trim()
|
||||
.replace(`${window.location.origin}/`, '')
|
||||
)
|
||||
}}
|
||||
submitLabel={t('joinInputSubmit')}
|
||||
>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user