Skip to content

Commit

Permalink
Merge pull request #4875 from Expensify/jules-removeGrowlFromVBAFlow
Browse files Browse the repository at this point in the history
Remove Growl from VBA flow, for non-server errors
  • Loading branch information
nkuoch authored Aug 27, 2021
2 parents 7e926e1 + 60adff6 commit 887778c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/libs/actions/BankAccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,18 @@ function validateBankAccount(bankAccountID, validateCode) {
});
}

function showBankAccountFormValidationError(error) {
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {error}).then(() => Growl.error(error));
/**
* Set the current error message. Show Growl for server errors as they are not yet handled by the error Modal.
*
* @param {String} error
* @param {Boolean} isServerError
*/
function showBankAccountFormValidationError(error, isServerError) {
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {error}).then(() => {
if (isServerError) {
Growl.error(error);
}
});
}

/**
Expand Down Expand Up @@ -777,7 +787,7 @@ function setupWithdrawalAccount(data) {
goToWithdrawalAccountSetupStep(nextStep, achData);

if (error) {
showBankAccountFormValidationError(error);
showBankAccountFormValidationError(error, true);
}
})
.catch((response) => {
Expand Down

0 comments on commit 887778c

Please sign in to comment.