Skip to content

Commit

Permalink
Merge pull request #55005 from rayane-djouah/fix-welcome-modal-not-di…
Browse files Browse the repository at this point in the history
…splaying

Fix: "Travel and expense" modal not showing for migrated users
(cherry picked from commit ab139e1)

(CP triggered by thienlnam)
  • Loading branch information
puneetlath authored and OSBotify committed Jan 9, 2025
1 parent 781ce07 commit c3a3477
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/hooks/useOnboardingFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand All @@ -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;
}
Expand Down Expand Up @@ -76,6 +81,7 @@ function useOnboardingFlowRouter() {
}
});
}, [
isLoadingApp,
isOnboardingCompleted,
isHybridAppOnboardingCompleted,
isOnboardingCompletedMetadata,
Expand Down

0 comments on commit c3a3477

Please sign in to comment.