From f877de700e13692b8c557a6852cf9a5fe13046d5 Mon Sep 17 00:00:00 2001 From: Gustavo Emanuel Farias Rosa Date: Wed, 29 Jun 2022 17:24:44 -0300 Subject: [PATCH] solving name portal bugs (#46) --- react-native/app/routes/component.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/react-native/app/routes/component.tsx b/react-native/app/routes/component.tsx index 5109e9e..f7cabbd 100644 --- a/react-native/app/routes/component.tsx +++ b/react-native/app/routes/component.tsx @@ -30,12 +30,18 @@ const DeepLink = ()=>{ navigate.navigate(i18next.t('mobileApp.portals.drawerNavigation.button.label')) return Alert.alert(i18next.t('mobileApp.portals.handleWithoutURL')) } - const roomName = linkWithoutScheme.match(/^\w+/) + let roomNameWBar = linkWithoutScheme.match(/^[A-z-.\w]+\//) + if(!roomNameWBar) { + navigate.navigate(i18next.t('mobileApp.portals.drawerNavigation.button.label')) + return Alert.alert(i18next.t('mobileApp.portals.handleWithoutURL')) + } + let roomName = roomNameWBar[0].replace(/\//, '') + if(roomName != 'bigbluebutton'){ - NAME_PORTALS_DEEP_LINK = roomName[0] + NAME_PORTALS_DEEP_LINK = roomName } - const linkWhitoutSchemeAndName = linkWithoutScheme.replace(/^\w+[\/]/, '') + const linkWhitoutSchemeAndName = linkWithoutScheme.replace(/^[A-z-.\w]+\//, '') const portalToAdd:IPortal = { name: NAME_PORTALS_DEEP_LINK, url: SCHEME_DEFAULT+linkWhitoutSchemeAndName,