Skip to content

Commit

Permalink
Merge pull request #32158 from tienifr/fix/28495
Browse files Browse the repository at this point in the history
Add desktop's `app://-/` origin to linking prefixes
  • Loading branch information
johnmlee101 authored Dec 12, 2023
2 parents a3354d7 + 2ee09db commit 4e3c34b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/libs/Navigation/linkingConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ import SCREENS from '@src/SCREENS';
import {RootStackParamList} from './types';

const linkingConfig: LinkingOptions<RootStackParamList> = {
prefixes: ['new-expensify://', 'https://www.expensify.cash', 'https://staging.expensify.cash', 'https://dev.new.expensify.com', CONST.NEW_EXPENSIFY_URL, CONST.STAGING_NEW_EXPENSIFY_URL],
prefixes: [
'app://-/',
'new-expensify://',
'https://www.expensify.cash',
'https://staging.expensify.cash',
'https://dev.new.expensify.com',
CONST.NEW_EXPENSIFY_URL,
CONST.STAGING_NEW_EXPENSIFY_URL,
],
config: {
initialRouteName: SCREENS.HOME,
screens: {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3677,8 +3677,8 @@ function getRouteFromLink(url: string | null): string {

// Get the reportID from URL
let route = url;
const localWebAndroidRegEx = /^(https:\/\/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3}))/;
linkingConfig.prefixes.forEach((prefix) => {
const localWebAndroidRegEx = /^(http:\/\/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3}))/;
if (route.startsWith(prefix)) {
route = route.replace(prefix, '');
} else if (localWebAndroidRegEx.test(route)) {
Expand Down

0 comments on commit 4e3c34b

Please sign in to comment.