From b7a9a4fb56e464a943fc2b82fda9d2b56a3c4422 Mon Sep 17 00:00:00 2001 From: Scott Deeter Date: Thu, 24 Oct 2024 14:10:45 -0700 Subject: [PATCH 1/5] Conditionally add nvp_onboarding when not invited --- src/libs/actions/IOU.ts | 2 +- src/libs/actions/Report.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 497f43f93317..531f8176021a 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -7604,7 +7604,7 @@ function completePaymentOnboarding(paymentSelected: ValueOf, full = true) { diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index dce8f2d19559..45fd68df1be7 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3329,6 +3329,7 @@ function completeOnboarding( paymentSelected?: string, companySize?: OnboardingCompanySizeType, userReportedIntegration?: OnboardingAccountingType, + wasInvited = false, ) { const actorAccountID = CONST.ACCOUNT_ID.CONCIERGE; const targetChatReport = ReportUtils.getChatByParticipants([actorAccountID, currentUserAccountID]); @@ -3574,12 +3575,14 @@ function completeOnboarding( key: ONYXKEYS.NVP_INTRO_SELECTED, value: {choice: engagementChoice}, }, - { + ); + if (!wasInvited) { + optimisticData.push({ onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.NVP_ONBOARDING, value: {hasCompletedGuidedSetupFlow: true}, - }, - ); + }); + } const successData: OnyxUpdate[] = [...tasksForSuccessData]; successData.push({ From 45e8f104b299128b7a565da3fbb6bff70a81fb9c Mon Sep 17 00:00:00 2001 From: Scott Deeter Date: Thu, 24 Oct 2024 16:15:57 -0700 Subject: [PATCH 2/5] Add undefined params to get pamentSeleted in right place; wasinvited too --- src/libs/actions/IOU.ts | 13 ++++++++++++- src/libs/actions/Report.ts | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 531f8176021a..7d0281a43b21 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -7604,7 +7604,18 @@ function completePaymentOnboarding(paymentSelected: ValueOf, full = true) { diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 45fd68df1be7..6e5ecf7f53a6 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3329,7 +3329,7 @@ function completeOnboarding( paymentSelected?: string, companySize?: OnboardingCompanySizeType, userReportedIntegration?: OnboardingAccountingType, - wasInvited = false, + wasInvited?: boolean, ) { const actorAccountID = CONST.ACCOUNT_ID.CONCIERGE; const targetChatReport = ReportUtils.getChatByParticipants([actorAccountID, currentUserAccountID]); From 9935cc3d8449f8a71c80522eff09a0defceedcd7 Mon Sep 17 00:00:00 2001 From: Scott Deeter Date: Thu, 24 Oct 2024 16:27:47 -0700 Subject: [PATCH 3/5] Apply same reasoning to failure data --- src/libs/actions/Report.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 6e5ecf7f53a6..84b438d4a2fa 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3637,6 +3637,9 @@ function completeOnboarding( key: ONYXKEYS.NVP_INTRO_SELECTED, value: {choice: null}, }, + ); + + if (!wasInvited) failureData.push( { onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.NVP_ONBOARDING, From 38d75c4255ff953f1188061704251bf18fe69749 Mon Sep 17 00:00:00 2001 From: Scott Deeter Date: Thu, 24 Oct 2024 17:17:21 -0700 Subject: [PATCH 4/5] Fix bad syntax --- src/libs/actions/Report.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 84b438d4a2fa..91eec9df1d77 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3639,13 +3639,13 @@ function completeOnboarding( }, ); - if (!wasInvited) failureData.push( - { + if (!wasInvited) { + failureData.push({ onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.NVP_ONBOARDING, value: {hasCompletedGuidedSetupFlow: false}, - }, - ); + }); + } if (userReportedIntegration) { optimisticData.push({ From 635ffc58bab75a4fa74c9260fcc72aab2f3fcd6a Mon Sep 17 00:00:00 2001 From: Scott Deeter Date: Wed, 13 Nov 2024 11:23:05 -0800 Subject: [PATCH 5/5] Resolve bad merge conflict --- src/libs/actions/Report.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 63c5959a22ee..7bae11fe06e9 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3896,6 +3896,7 @@ function completeOnboarding( paymentSelected?: string, companySize?: OnboardingCompanySize, userReportedIntegration?: OnboardingAccounting, + wasInvited?: boolean, ) { const {optimisticData, successData, failureData, guidedSetupData, actorAccountID} = prepareOnboardingOptimisticData( engagementChoice, @@ -3903,6 +3904,7 @@ function completeOnboarding( adminsChatReportID, onboardingPolicyID, userReportedIntegration, + wasInvited, ); const parameters: CompleteGuidedSetupParams = {