solving name portal bugs (#46)

This commit is contained in:
Gustavo Emanuel Farias Rosa 2022-06-29 17:24:44 -03:00 committed by GitHub
parent 62bd0a9f59
commit f877de700e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,12 +30,18 @@ const DeepLink = ()=>{
navigate.navigate(i18next.t('mobileApp.portals.drawerNavigation.button.label')) navigate.navigate(i18next.t('mobileApp.portals.drawerNavigation.button.label'))
return Alert.alert(i18next.t('mobileApp.portals.handleWithoutURL')) 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'){ 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 = { const portalToAdd:IPortal = {
name: NAME_PORTALS_DEEP_LINK, name: NAME_PORTALS_DEEP_LINK,
url: SCHEME_DEFAULT+linkWhitoutSchemeAndName, url: SCHEME_DEFAULT+linkWhitoutSchemeAndName,