Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Start over button #8808

Merged
merged 1 commit into from
Apr 27, 2022
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
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