Skip to content

Commit 67adc77

Browse files
committed
show blocking screen for all failures of addWorkEmail
1 parent dba4d8c commit 67adc77

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/CONST/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1792,7 +1792,6 @@ const CONST = {
17921792
GATEWAY_TIMEOUT: 'Gateway Timeout',
17931793
EXPENSIFY_SERVICE_INTERRUPTED: 'Expensify service interrupted',
17941794
DUPLICATE_RECORD: 'A record already exists with this ID',
1795-
ONBOARDING_2FA_REQUIRED_ERROR_MESSAGE: '401 work account uses 2FA',
17961795

17971796
// The "Upgrade" is intentional as the 426 HTTP code means "Upgrade Required" and sent by the API. We use the "Update" language everywhere else in the front end when this gets returned.
17981797
UPDATE_REQUIRED: 'Upgrade Required',

src/libs/actions/Session/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,13 @@ function AddWorkEmail(workEmail: string) {
12881288
isLoading: false,
12891289
},
12901290
},
1291+
{
1292+
onyxMethod: Onyx.METHOD.MERGE,
1293+
key: ONYXKEYS.NVP_ONBOARDING,
1294+
value: {
1295+
isMergingAccountBlocked: true,
1296+
},
1297+
},
12911298
];
12921299

12931300
API.write(

src/pages/OnboardingWorkEmail/BaseOnboardingWorkEmail.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ function BaseOnboardingWorkEmail({shouldUseNativeStyles}: BaseOnboardingWorkEmai
129129
},
130130
];
131131

132-
const isMergingAccountBlocked = onboardingErrorMessage === CONST.ERROR.ONBOARDING_2FA_REQUIRED_ERROR_MESSAGE;
133-
134132
return (
135133
<ScreenWrapper
136134
shouldEnableMaxHeight
@@ -142,7 +140,7 @@ function BaseOnboardingWorkEmail({shouldUseNativeStyles}: BaseOnboardingWorkEmai
142140
progressBarPercentage={10}
143141
shouldShowBackButton={false}
144142
/>
145-
{isMergingAccountBlocked ? (
143+
{onboardingValues?.isMergingAccountBlocked ? (
146144
<View style={[styles.flex1, onboardingIsMediumOrLargerScreenWidth && styles.mt5, onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}>
147145
<OnboardingMergingAccountBlockedView
148146
workEmail={workEmail}

0 commit comments

Comments
 (0)