Skip to content
Merged
Changes from all commits
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
12 changes: 11 additions & 1 deletion src/libs/actions/BankAccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,12 @@ function fetchUserWallet() {
function fetchFreePlanVerifiedBankAccount(stepToOpen) {
// We are using set here since we will rely on data from the server (not local data) to populate the VBA flow
// and determine which step to navigate to.
Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: true});
Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {
loading: true,

// We temporarily keep the achData state to prevent UI changes while fetching.
Comment thread
marcaaron marked this conversation as resolved.
achData: {state: lodashGet(reimbursementAccountInSetup, 'state', '')},
});
let bankAccountID;

API.Get({
Expand Down Expand Up @@ -403,6 +408,11 @@ function fetchFreePlanVerifiedBankAccount(stepToOpen) {
achData.bankAccountInReview = bankAccount && bankAccount.isVerifying();
achData.domainLimit = 0;

// Adding a default empty state to make sure we override the temporary one we are keeping
// for UI purposes. This covers an edge case in which a user deleted their bank account,
// but would still see Finish Setup in the UI, instead of Get Started.
achData.state = lodashGet(achData, 'state', '');
Comment thread
marcaaron marked this conversation as resolved.

// If the bank account has already been created in the db and is not yet open
// let's show the manual form with the previously added values
achData.subStep = bankAccount && bankAccount.isInSetup()
Expand Down