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

Fix account not validated error is not displayed on the Connect bank account page #49130

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/pages/ReimbursementAccount/BankAccountStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import type * as OnyxTypes from '@src/types/onyx';
import BankInfo from './BankInfo/BankInfo';

type BankAccountStepOnyxProps = {
/** Object with various information about the user */
user: OnyxEntry<OnyxTypes.User>;
/** Holds information about the users account that is logging in */
account: OnyxEntry<OnyxTypes.Account>;

/** If the plaid button has been disabled */
isPlaidDisabled: OnyxEntry<boolean>;
Expand Down Expand Up @@ -66,7 +66,7 @@ function BankAccountStep({
plaidLinkOAuthToken = '',
policyID = '',
policyName = '',
user,
account,
receivedRedirectURI,
reimbursementAccount,
onBackButtonPress,
Expand Down Expand Up @@ -155,9 +155,9 @@ function BankAccountStep({
<MenuItem
icon={Expensicons.Bank}
title={translate('bankAccount.connectOnlineWithPlaid')}
disabled={!!isPlaidDisabled || !user?.validated}
disabled={!!isPlaidDisabled || !account?.validated}
onPress={() => {
if (!!isPlaidDisabled || !user?.validated) {
if (!!isPlaidDisabled || !account?.validated) {
return;
}
removeExistingBankAccountDetails();
Expand All @@ -171,7 +171,7 @@ function BankAccountStep({
<MenuItem
icon={Expensicons.Connect}
title={translate('bankAccount.connectManually')}
disabled={!user?.validated}
disabled={!account?.validated}
onPress={() => {
removeExistingBankAccountDetails();
BankAccounts.setBankAccountSubStep(CONST.BANK_ACCOUNT.SETUP_TYPE.MANUAL);
Expand All @@ -181,7 +181,7 @@ function BankAccountStep({
/>
</View>
</Section>
{!user?.validated && <ValidateAccountMessage />}
{!account?.validated && <ValidateAccountMessage />}
<View style={[styles.mv0, styles.mh5, styles.flexRow, styles.justifyContentBetween]}>
<TextLink href={CONST.PRIVACY_URL}>{translate('common.privacy')}</TextLink>
<PressableWithoutFeedback
Expand All @@ -207,8 +207,8 @@ function BankAccountStep({
BankAccountStep.displayName = 'BankAccountStep';

export default withOnyx<BankAccountStepProps, BankAccountStepOnyxProps>({
CyberAndrii marked this conversation as resolved.
Show resolved Hide resolved
user: {
key: ONYXKEYS.USER,
account: {
key: ONYXKEYS.ACCOUNT,
},
isPlaidDisabled: {
key: ONYXKEYS.IS_PLAID_DISABLED,
Expand Down
Loading