File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -202,6 +202,10 @@ function Expensify() {
202202
203203 // If the app is opened from a deep link, get the reportID (if exists) from the deep link and navigate to the chat report
204204 Linking . getInitialURL ( ) . then ( ( url ) => {
205+ // We use custom deeplink handler in setup/hybridApp
206+ if ( CONFIG . IS_HYBRID_APP ) {
207+ return ;
208+ }
205209 setInitialUrl ( url ) ;
206210 Report . openReportFromDeepLink ( url ?? '' ) ;
207211 } ) ;
Original file line number Diff line number Diff line change @@ -3407,7 +3407,7 @@ function openReportFromDeepLink(url: string) {
34073407 // We don't want to navigate to the exitTo route when creating a new workspace from a deep link,
34083408 // because we already handle creating the optimistic policy and navigating to it in App.setUpPoliciesAndNavigate,
34093409 // which is already called when AuthScreens mounts.
3410- if ( url && new URL ( url ) . searchParams . get ( 'exitTo' ) === ROUTES . WORKSPACE_NEW ) {
3410+ if ( ! CONFIG . IS_HYBRID_APP && url && new URL ( url ) . searchParams . get ( 'exitTo' ) === ROUTES . WORKSPACE_NEW ) {
34113411 return ;
34123412 }
34133413
@@ -3428,10 +3428,6 @@ function openReportFromDeepLink(url: string) {
34283428 return ;
34293429 }
34303430
3431- if ( isAuthenticated ) {
3432- return ;
3433- }
3434-
34353431 // Check if the report exists in the collection
34363432 const report = allReports ?. [ `${ ONYXKEYS . COLLECTION . REPORT } ${ reportID } ` ] ;
34373433 // If the report does not exist, navigate to the last accessed report or Concierge chat
Original file line number Diff line number Diff line change 1- import { findFocusedRoute } from '@react-navigation/native' ;
21import { Linking } from 'react-native' ;
3- import Navigation , { navigationRef } from '@navigation/Navigation' ;
2+ import Navigation from '@navigation/Navigation' ;
3+ import { openReportFromDeepLink } from '@userActions/Report' ;
44import CONFIG from '@src/CONFIG' ;
55import type { Route } from '@src/ROUTES' ;
6- import ROUTES from '@src/ROUTES' ;
7- import SCREENS from '@src/SCREENS' ;
86
97if ( CONFIG . IS_HYBRID_APP ) {
108 Linking . addEventListener ( 'url' , ( state ) => {
11- handleHybridUrlNavigation ( state . url as Route ) ;
12- } ) ;
13- }
14-
15- function handleHybridUrlNavigation ( url : Route ) {
16- const parsedUrl = Navigation . parseHybridAppUrl ( url ) ;
17-
18- Navigation . isNavigationReady ( ) . then ( ( ) => {
19- if ( parsedUrl . startsWith ( `/${ ROUTES . SHARE_ROOT } ` ) ) {
20- const focusRoute = findFocusedRoute ( navigationRef . getRootState ( ) ) ;
21- if ( focusRoute ?. name === SCREENS . SHARE . SHARE_DETAILS || focusRoute ?. name === SCREENS . SHARE . SUBMIT_DETAILS ) {
22- Navigation . goBack ( ROUTES . SHARE_ROOT ) ;
23- return ;
24- }
25- }
26- Navigation . navigate ( parsedUrl ) ;
9+ const parsedUrl = Navigation . parseHybridAppUrl ( state . url as Route ) ;
10+ openReportFromDeepLink ( parsedUrl ) ;
2711 } ) ;
2812}
You can’t perform that action at this time.
0 commit comments