1- import React , { useCallback , useContext , useEffect , useMemo , useState } from 'react' ;
1+ import React , { useCallback , useContext , useEffect , useMemo , useRef , useState } from 'react' ;
22import { InteractionManager , View } from 'react-native' ;
33import Button from '@components/Button' ;
44import Checkbox from '@components/Checkbox' ;
@@ -64,6 +64,7 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
6464 const { isOffline} = useNetwork ( ) ;
6565 const isLoading = onboarding ?. isLoading ;
6666 const prevIsLoading = usePrevious ( isLoading ) ;
67+ const didOpenOldDotLink = useRef ( false ) ;
6768
6869 const features : Feature [ ] = useMemo ( ( ) => {
6970 return [
@@ -148,7 +149,7 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
148149 } , [ paidGroupPolicy , onboardingPolicyID ] ) ;
149150
150151 useEffect ( ( ) => {
151- if ( ! ! isLoading || ! prevIsLoading ) {
152+ if ( ! ! isLoading || ! prevIsLoading || didOpenOldDotLink . current ) {
152153 return ;
153154 }
154155
@@ -158,6 +159,7 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
158159 return ;
159160 }
160161 waitForIdle ( ) . then ( ( ) => {
162+ didOpenOldDotLink . current = true ;
161163 openOldDotLink ( CONST . OLDDOT_URLS . INBOX , true ) ;
162164 } ) ;
163165 } , [ isLoading , prevIsLoading , setRootStatusBarEnabled ] ) ;
@@ -204,10 +206,12 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
204206 } ) ;
205207
206208 if ( shouldOnboardingRedirectToOldDot ( onboardingCompanySize , newUserReportedIntegration ) ) {
207- if ( CONFIG . IS_HYBRID_APP ) {
209+ if ( CONFIG . IS_HYBRID_APP || didOpenOldDotLink . current ) {
208210 return ;
209211 }
212+ didOpenOldDotLink . current = true ;
210213 openOldDotLink ( CONST . OLDDOT_URLS . INBOX , true ) ;
214+ return ;
211215 }
212216
213217 // Avoid creating new WS because onboardingPolicyID is cleared before unmounting
0 commit comments