Skip to content

Commit

Permalink
Merge pull request #8808 from Expensify/cmartins-StartOver
Browse files Browse the repository at this point in the history
Fix Start over button
  • Loading branch information
neil-marcellini authored Apr 27, 2022
2 parents 6333e6a + 40dd916 commit 9bf9128
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import * as API from '../../API';
import CONST from '../../../CONST';
import * as store from './store';
import Growl from '../../Growl';
import deleteFromBankAccountList from './deleteFromBankAccountList';
import Navigation from '../../Navigation/Navigation';
import ROUTES from '../../../ROUTES';

/**
* Reset user's reimbursement account. This will delete the bank account.
Expand All @@ -32,7 +33,7 @@ function resetFreePlanBankAccount() {
return;
}

// Reset reimbursement account, and clear draft user input, and the bank account list
// Reset reimbursement account, and clear draft user input
const achData = {
useOnfido: true,
policyID: '',
Expand All @@ -41,12 +42,12 @@ function resetFreePlanBankAccount() {
currentStep: CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT,
};

deleteFromBankAccountList(bankAccountID);
Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {achData});
Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT, null);

// Clear the NVP for the bank account so the user can add a new one
// Clear the NVP for the bank account so the user can add a new one and navigate back to bank account page
API.SetNameValuePair({name: CONST.NVP.FREE_PLAN_BANK_ACCOUNT_ID, value: ''});
Navigation.navigate(ROUTES.getBankAccountRoute());
});
}

Expand Down

0 comments on commit 9bf9128

Please sign in to comment.