From 6fc7cf5f3516d3c46b1b69a8de940865a450537d Mon Sep 17 00:00:00 2001 From: Rayane Djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Wed, 8 Jan 2025 00:40:38 +0100 Subject: [PATCH 1/2] hide the "Welcome to Expensify" modal when user is migrated --- src/components/ExplanationModal.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/ExplanationModal.tsx b/src/components/ExplanationModal.tsx index d846dd4d28bac..88b2f4003cbf2 100644 --- a/src/components/ExplanationModal.tsx +++ b/src/components/ExplanationModal.tsx @@ -1,11 +1,20 @@ import React from 'react'; +import {useOnyx} from 'react-native-onyx'; import useLocalize from '@hooks/useLocalize'; import * as Welcome from '@userActions/Welcome'; import CONST from '@src/CONST'; +import ONYXKEYS from '@src/ONYXKEYS'; import FeatureTrainingModal from './FeatureTrainingModal'; function ExplanationModal() { const {translate} = useLocalize(); + const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRYNEWDOT); + const hasBeenAddedToNudgeMigration = !!tryNewDot?.nudgeMigration?.timestamp; + + // If the user has already seen the welcome video, don't show it again + if (hasBeenAddedToNudgeMigration) { + return null; + } return ( Date: Wed, 8 Jan 2025 01:06:57 +0100 Subject: [PATCH 2/2] add early return if hasBeenAddedToNudgeMigration --- src/components/ExplanationModal.tsx | 1 - src/hooks/useOnboardingFlow.ts | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ExplanationModal.tsx b/src/components/ExplanationModal.tsx index 88b2f4003cbf2..9c44bc4d0fd3a 100644 --- a/src/components/ExplanationModal.tsx +++ b/src/components/ExplanationModal.tsx @@ -11,7 +11,6 @@ function ExplanationModal() { const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRYNEWDOT); const hasBeenAddedToNudgeMigration = !!tryNewDot?.nudgeMigration?.timestamp; - // If the user has already seen the welcome video, don't show it again if (hasBeenAddedToNudgeMigration) { return null; } diff --git a/src/hooks/useOnboardingFlow.ts b/src/hooks/useOnboardingFlow.ts index e1e659fd4eb13..a1a1ed2c00e51 100644 --- a/src/hooks/useOnboardingFlow.ts +++ b/src/hooks/useOnboardingFlow.ts @@ -48,6 +48,10 @@ function useOnboardingFlowRouter() { return; } + if (hasBeenAddedToNudgeMigration) { + return; + } + if (NativeModules.HybridAppModule) { // For single entries, such as using the Travel feature from OldDot, we don't want to show onboarding if (isSingleNewDotEntry) {