From 50f4b5050d208e935ea576c92d4f0e2bc39cc74b Mon Sep 17 00:00:00 2001 From: twilight294 Date: Tue, 8 Oct 2024 02:51:16 +0530 Subject: [PATCH 1/5] Update AuthScreens.tsx --- src/libs/Navigation/AppNavigator/AuthScreens.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index f5f35fd21025..0453e496cecf 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -14,7 +14,6 @@ import usePermissions from '@hooks/usePermissions'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as Welcome from '@libs/actions/Welcome'; import {READ_COMMANDS} from '@libs/API/types'; import HttpUtils from '@libs/HttpUtils'; import KeyboardShortcut from '@libs/KeyboardShortcut'; @@ -274,18 +273,6 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie return; } - let signupQualifier; - if (currentUrl.includes(CONST.QUALIFIER_PARAM)) { - signupQualifier = new URL(currentUrl).searchParams.get(CONST.QUALIFIER_PARAM); - - if (signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.INDIVIDUAL) { - Welcome.setOnboardingCustomChoices([CONST.ONBOARDING_CHOICES.PERSONAL_SPEND, CONST.ONBOARDING_CHOICES.EMPLOYER, CONST.ONBOARDING_CHOICES.CHAT_SPLIT]); - } - if (signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB) { - Welcome.setOnboardingPurposeSelected(CONST.ONBOARDING_CHOICES.MANAGE_TEAM); - } - } - NetworkConnection.listenForReconnect(); NetworkConnection.onReconnect(handleNetworkReconnect); PusherConnectionManager.init(); From 3014565da820cb27bb1553ec960698688d9b1c63 Mon Sep 17 00:00:00 2001 From: twilight294 Date: Tue, 8 Oct 2024 02:51:42 +0530 Subject: [PATCH 2/5] Update OnboardingFlow.ts --- src/libs/actions/Welcome/OnboardingFlow.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Welcome/OnboardingFlow.ts b/src/libs/actions/Welcome/OnboardingFlow.ts index 4ab3cda27c64..0257faf39f14 100644 --- a/src/libs/actions/Welcome/OnboardingFlow.ts +++ b/src/libs/actions/Welcome/OnboardingFlow.ts @@ -115,11 +115,16 @@ function startOnboardingFlow() { function getOnboardingInitialPath(): string { const state = getStateFromPath(onboardingInitialPath, linkingConfig.config); - const showBusinessModal = onboardingValues && CONST.QUALIFIER_PARAM in onboardingValues && onboardingValues.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB; + const isVsb = onboardingValues.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB; - if (showBusinessModal) { + if (isVsb) { + Onyx.set(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, CONST.ONBOARDING_CHOICES.MANAGE_TEAM); return `/${ROUTES.ONBOARDING_WORK.route}`; } + const isIndividual = onboardingValues.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.INDIVIDUAL; + if (isIndividual) { + Onyx.set(ONYXKEYS.ONBOARDING_CUSTOM_CHOICES, [CONST.ONBOARDING_CHOICES.PERSONAL_SPEND, CONST.ONBOARDING_CHOICES.EMPLOYER, CONST.ONBOARDING_CHOICES.CHAT_SPLIT]); + } if (state?.routes?.at(-1)?.name !== NAVIGATORS.ONBOARDING_MODAL_NAVIGATOR) { return `/${ROUTES.ONBOARDING_ROOT.route}`; } From e1852f52a7ebf3b638e567f1d5b6e60b17ef4a30 Mon Sep 17 00:00:00 2001 From: twilight294 Date: Wed, 9 Oct 2024 02:23:08 +0530 Subject: [PATCH 3/5] cleanup const --- src/CONST.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index 075f661b8822..060b9223945a 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -4471,7 +4471,6 @@ const CONST = { WELCOME_VIDEO_URL: `${CLOUDFRONT_URL}/videos/intro-1280.mp4`, - QUALIFIER_PARAM: 'signupQualifier', ONBOARDING_INTRODUCTION: 'Let’s get you set up 🔧', ONBOARDING_CHOICES: {...onboardingChoices}, SELECTABLE_ONBOARDING_CHOICES: {...selectableOnboardingChoices}, From f9067dbce1794ba5ca20a4665974c1743ec750c9 Mon Sep 17 00:00:00 2001 From: twilight294 Date: Wed, 9 Oct 2024 02:30:16 +0530 Subject: [PATCH 4/5] fix type --- src/pages/OnboardingWork/BaseOnboardingWork.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/OnboardingWork/BaseOnboardingWork.tsx b/src/pages/OnboardingWork/BaseOnboardingWork.tsx index 9e8e2e3bbfa8..39330a0613cd 100644 --- a/src/pages/OnboardingWork/BaseOnboardingWork.tsx +++ b/src/pages/OnboardingWork/BaseOnboardingWork.tsx @@ -35,9 +35,8 @@ function BaseOnboardingWork({shouldUseNativeStyles, route}: BaseOnboardingWorkPr const {isSmallScreenWidth, onboardingIsMediumOrLargerScreenWidth} = useResponsiveLayout(); const {inputCallbackRef} = useAutoFocusInput(); const {isOffline} = useNetwork(); - - const isVsbOnboarding = onboardingValues && CONST.QUALIFIER_PARAM in onboardingValues && onboardingValues.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB; - + const isVsbOnboarding = Array.isArray(onboardingValues) ? false : onboardingValues?.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB; + const completeEngagement = useCallback( (values: FormOnyxValues<'onboardingWorkForm'>) => { if (!onboardingPurposeSelected) { From 577b62023abdcbb72b02e6175766e7611007fcaf Mon Sep 17 00:00:00 2001 From: twilight294 Date: Wed, 9 Oct 2024 02:36:14 +0530 Subject: [PATCH 5/5] fix prettier --- src/pages/OnboardingWork/BaseOnboardingWork.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/OnboardingWork/BaseOnboardingWork.tsx b/src/pages/OnboardingWork/BaseOnboardingWork.tsx index 39330a0613cd..e11e52f373b6 100644 --- a/src/pages/OnboardingWork/BaseOnboardingWork.tsx +++ b/src/pages/OnboardingWork/BaseOnboardingWork.tsx @@ -36,7 +36,7 @@ function BaseOnboardingWork({shouldUseNativeStyles, route}: BaseOnboardingWorkPr const {inputCallbackRef} = useAutoFocusInput(); const {isOffline} = useNetwork(); const isVsbOnboarding = Array.isArray(onboardingValues) ? false : onboardingValues?.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB; - + const completeEngagement = useCallback( (values: FormOnyxValues<'onboardingWorkForm'>) => { if (!onboardingPurposeSelected) {