From 4a89a323de4633521454a895756b2aa6db806685 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 13 Oct 2021 12:23:03 -0700 Subject: [PATCH] Merge pull request #5803 from Expensify/yuwen-betterSteps Don't dismiss the Reimbursement Account Page after validating a withdrawal account (cherry picked from commit 27b23b57f644fba7252d5cf2d54b6838d65496e8) --- src/libs/actions/BankAccounts.js | 9 +-------- .../ReimbursementAccount/ReimbursementAccountForm.js | 9 ++++++++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index f2697261a6f..e8dac3382bf 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -9,7 +9,6 @@ import * as API from '../API'; import BankAccount from '../models/BankAccount'; import Growl from '../Growl'; import {translateLocal} from '../translate'; -import Navigation from '../Navigation/Navigation'; /** * List of bank accounts. This data should not be stored in Onyx since it contains unmasked PANs. @@ -574,7 +573,6 @@ function validateBankAccount(bankAccountID, validateCode) { API.BankAccount_Validate({bankAccountID, validateCode}) .then((response) => { if (response.jsonCode === 200) { - Growl.show('Bank Account successfully validated!', CONST.GROWL.SUCCESS, 5000); Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT, null); API.User_IsUsingExpensifyCard() .then(({isUsingExpensifyCard}) => { @@ -584,12 +582,7 @@ function validateBankAccount(bankAccountID, validateCode) { achData: {state: BankAccount.STATE.OPEN}, }; - if (isUsingExpensifyCard) { - Navigation.dismissModal(); - } else { - reimbursementAccount.achData.currentStep = CONST.BANK_ACCOUNT.STEP.ENABLE; - } - + reimbursementAccount.achData.currentStep = CONST.BANK_ACCOUNT.STEP.ENABLE; Onyx.merge(ONYXKEYS.USER, {isUsingExpensifyCard}); Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, reimbursementAccount); }); diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountForm.js b/src/pages/ReimbursementAccount/ReimbursementAccountForm.js index 3b1d5babd43..78a6be66527 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountForm.js +++ b/src/pages/ReimbursementAccount/ReimbursementAccountForm.js @@ -11,6 +11,7 @@ import reimbursementAccountPropTypes from './reimbursementAccountPropTypes'; import compose from '../../libs/compose'; import ONYXKEYS from '../../ONYXKEYS'; import FormAlertWithSubmitButton from '../../components/FormAlertWithSubmitButton'; +import CONST from '../../CONST'; const propTypes = { /** ACH data for the withdrawal account actively being set up */ @@ -34,6 +35,12 @@ class ReimbursementAccountForm extends React.Component { // @TODO once all validation errors show in multiples we can remove this check || lodashGet(this.props, 'reimbursementAccount.error', '').length > 0; + const currentStep = lodashGet( + this.props, + 'reimbursementAccount.achData.currentStep', + CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT, + ); + return ( { this.form.scrollTo({y: 0, animated: true});