diff --git a/src/hooks/useOnboardingFlow.ts b/src/hooks/useOnboardingFlow.ts index a1a1ed2c00e5..26b59778b8e2 100644 --- a/src/hooks/useOnboardingFlow.ts +++ b/src/hooks/useOnboardingFlow.ts @@ -16,6 +16,7 @@ import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; * Warning: This hook should be used only once in the app */ function useOnboardingFlowRouter() { + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP, {initialValue: true}); const [isOnboardingCompleted, isOnboardingCompletedMetadata] = useOnyx(ONYXKEYS.NVP_ONBOARDING, { selector: hasCompletedGuidedSetupFlowSelector, }); @@ -32,6 +33,10 @@ function useOnboardingFlowRouter() { useEffect(() => { // This should delay opening the onboarding modal so it does not interfere with the ongoing ReportScreen params changes InteractionManager.runAfterInteractions(() => { + if (isLoadingApp) { + return; + } + if (isLoadingOnyxValue(isOnboardingCompletedMetadata, tryNewDotdMetadata, dismissedProductTrainingMetadata)) { return; } @@ -76,6 +81,7 @@ function useOnboardingFlowRouter() { } }); }, [ + isLoadingApp, isOnboardingCompleted, isHybridAppOnboardingCompleted, isOnboardingCompletedMetadata,