diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 89eec7835e0..b038f16d003 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -57,7 +57,6 @@ import {prepareDraftComment} from '@libs/DraftCommentUtils'; import * as EmojiUtils from '@libs/EmojiUtils'; import * as Environment from '@libs/Environment/Environment'; import * as ErrorUtils from '@libs/ErrorUtils'; -import hasCompletedGuidedSetupFlowSelector from '@libs/hasCompletedGuidedSetupFlowSelector'; import HttpUtils from '@libs/HttpUtils'; import isPublicScreenRoute from '@libs/isPublicScreenRoute'; import * as Localize from '@libs/Localize'; @@ -2694,32 +2693,29 @@ function openReportFromDeepLink(url: string) { return; } - const state = navigationRef.getRootState(); - const currentFocusedRoute = findFocusedRoute(state); - const hasCompletedGuidedSetupFlow = hasCompletedGuidedSetupFlowSelector(onboarding); - // We need skip deeplinking if the user hasn't completed the guided setup flow. - if (!hasCompletedGuidedSetupFlow) { - Welcome.isOnboardingFlowCompleted({ - onNotCompleted: () => OnboardingFlow.startOnboardingFlow(), - }); - return; - } - - if (isOnboardingFlowName(currentFocusedRoute?.name)) { - Welcome.setOnboardingErrorMessage(Localize.translateLocal('onboarding.purpose.errorBackButton')); - return; - } - - if (shouldSkipDeepLinkNavigation(route)) { - return; - } - - if (isAuthenticated) { - return; - } - - Navigation.navigate(route as Route, CONST.NAVIGATION.ACTION_TYPE.PUSH); + Welcome.isOnboardingFlowCompleted({ + onNotCompleted: () => OnboardingFlow.startOnboardingFlow(), + onCompleted: () => { + const state = navigationRef.getRootState(); + const currentFocusedRoute = findFocusedRoute(state); + + if (isOnboardingFlowName(currentFocusedRoute?.name)) { + Welcome.setOnboardingErrorMessage(Localize.translateLocal('onboarding.purpose.errorBackButton')); + return; + } + + if (shouldSkipDeepLinkNavigation(route)) { + return; + } + + if (isAuthenticated) { + return; + } + + Navigation.navigate(route as Route, CONST.NAVIGATION.ACTION_TYPE.PUSH); + }, + }); }); }, });