From c3a347707656599fd7429284eaa16f16405babfa Mon Sep 17 00:00:00 2001 From: Puneet Lath Date: Thu, 9 Jan 2025 14:25:55 -0500 Subject: [PATCH] Merge pull request #55005 from rayane-djouah/fix-welcome-modal-not-displaying Fix: "Travel and expense" modal not showing for migrated users (cherry picked from commit ab139e1333310f2935bb07d705f0689c24e24650) (CP triggered by thienlnam) --- src/hooks/useOnboardingFlow.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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,