File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -203,6 +203,10 @@ function Expensify() {
203203
204204 // If the app is opened from a deep link, get the reportID (if exists) from the deep link and navigate to the chat report
205205 Linking . getInitialURL ( ) . then ( ( url ) => {
206+ // We use custom deeplink handler in setup/hybridApp
207+ if ( CONFIG . IS_HYBRID_APP ) {
208+ return ;
209+ }
206210 setInitialUrl ( url ) ;
207211 Report . openReportFromDeepLink ( url ?? '' ) ;
208212 } ) ;
Original file line number Diff line number Diff line change @@ -3384,7 +3384,7 @@ function openReportFromDeepLink(url: string) {
33843384 // We don't want to navigate to the exitTo route when creating a new workspace from a deep link,
33853385 // because we already handle creating the optimistic policy and navigating to it in App.setUpPoliciesAndNavigate,
33863386 // which is already called when AuthScreens mounts.
3387- if ( url && new URL ( url ) . searchParams . get ( 'exitTo' ) === ROUTES . WORKSPACE_NEW ) {
3387+ if ( ! CONFIG . IS_HYBRID_APP && url && new URL ( url ) . searchParams . get ( 'exitTo' ) === ROUTES . WORKSPACE_NEW ) {
33883388 return ;
33893389 }
33903390
@@ -3405,10 +3405,6 @@ function openReportFromDeepLink(url: string) {
34053405 return ;
34063406 }
34073407
3408- if ( isAuthenticated ) {
3409- return ;
3410- }
3411-
34123408 // Check if the report exists in the collection
34133409 const report = allReports ?. [ `${ ONYXKEYS . COLLECTION . REPORT } ${ reportID } ` ] ;
34143410 // 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' ;
43import CONFIG from '@src/CONFIG' ;
54import type { Route } from '@src/ROUTES' ;
6- import ROUTES from '@src/ROUTES' ;
7- import SCREENS from '@src/SCREENS' ;
5+ import { openReportFromDeepLink } from '@userActions/Report' ;
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