File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -335,14 +335,16 @@ function fetchUserWallet() {
335
335
* Fetch the bank account currently being set up by the user for the free plan if it exists.
336
336
*
337
337
* @param {String } [stepToOpen]
338
- * @param {Boolean } [hasLocalOpenVBA ]
338
+ * @param {String } [localBankAccountState ]
339
339
*/
340
- function fetchFreePlanVerifiedBankAccount ( stepToOpen , hasLocalOpenVBA = false ) {
340
+ function fetchFreePlanVerifiedBankAccount ( stepToOpen , localBankAccountState ) {
341
341
// Remember which account BankAccountStep subStep the user had before so we can set it later
342
342
const subStep = lodashGet ( reimbursementAccountInSetup , 'subStep' , '' ) ;
343
343
const initialData = { loading : true , error : '' } ;
344
- if ( hasLocalOpenVBA ) {
345
- initialData . achData = { state : BankAccount . STATE . OPEN } ;
344
+
345
+ // Some UI needs to know the bank account state during the loading process, so we are keeping it in Onyx if passed
346
+ if ( localBankAccountState ) {
347
+ initialData . achData = { state : localBankAccountState } ;
346
348
}
347
349
348
350
// We are using set here since we will rely on data from the server (not local data) to populate the VBA flow
Original file line number Diff line number Diff line change @@ -47,8 +47,7 @@ const defaultProps = {
47
47
class WorkspacePageWithSections extends React . Component {
48
48
componentDidMount ( ) {
49
49
const achState = lodashGet ( this . props . reimbursementAccount , 'achData.state' , '' ) ;
50
- const hasVBA = achState === BankAccount . STATE . OPEN ;
51
- fetchFreePlanVerifiedBankAccount ( '' , hasVBA ) ;
50
+ fetchFreePlanVerifiedBankAccount ( '' , achState ) ;
52
51
}
53
52
54
53
render ( ) {
You can’t perform that action at this time.
0 commit comments