Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP staging] Prevent second attempts to activate wallet when Onfido checks fail #30114

Merged
merged 11 commits into from
Oct 24, 2023
15 changes: 15 additions & 0 deletions src/pages/settings/Wallet/WalletPage/WalletPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen
const shouldShowEmptyState = !hasBankAccount && !hasWallet && !hasAssignedCard;

const isPendingOnfidoResult = lodashGet(userWallet, 'isPendingOnfidoResult', false);
const hasFailedOnfido = lodashGet(userWallet, 'hasFailedOnfido', false);

const updateShouldShowLoadingSpinner = useCallback(() => {
// In order to prevent a loop, only update state of the spinner if there is a change
Expand Down Expand Up @@ -403,6 +404,20 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen
);
}

if (hasFailedOnfido) {
return (
<View style={[styles.flexRow, styles.alignItemsCenter, styles.m4]}>
<Icon
src={Expensicons.Exclamation}
fill={themeColors.textSupporting}
/>
<Text style={[styles.mutedTextLabel, styles.ml4, styles.flex1]}>
Unfortunately your wallet cannot be enabled at this time. Please chat with Concierge for further assistance.
</Text>
</View>
);
}

return (
<Button
ref={buttonRef}
Expand Down
3 changes: 3 additions & 0 deletions src/types/onyx/UserWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ type UserWallet = {
/** What step in the activation flow are we on? */
currentStep: ValueOf<typeof CONST.WALLET.STEP>;

/** If the user failed the Onfido verification check */
hasFailedOnfido?: boolean;

/** If we should show the FailedKYC view after the user submitted their info with a non fixable error */
shouldShowFailedKYC?: boolean;

Expand Down