Skip to content

Commit

Permalink
Reuse existing method
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuoch committed Jan 27, 2023
1 parent 4eebb61 commit 0227168
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/libs/actions/BankAccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ function validateBankAccount(bankAccountID, validateCode) {
}

function openReimbursementAccountPage(stepToOpen, subStep, localCurrentStep) {
// Show loader right away, as optimisticData might be set only later in case multiple calls are in the queue
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {isLoading: true});
const onyxData = {
optimisticData: [
{
Expand Down
3 changes: 3 additions & 0 deletions src/pages/ReimbursementAccount/ReimbursementAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ class ReimbursementAccountPage extends React.Component {
* @param {boolean} ignoreLocalCurrentStep Pass true if you want the last "updated" view (from db), not the last "viewed" view (from onyx).
*/
fetchData(ignoreLocalCurrentStep) {
// Show loader right away, as optimisticData might be set only later in case multiple calls are in the queue
BankAccounts.setReimbursementAccountLoading(true);

// We can specify a step to navigate to by using route params when the component mounts.
// We want to use the same stepToOpen variable when the network state changes because we can be redirected to a different step when the account refreshes.
const stepToOpen = this.getStepToOpenFromRouteParams();
Expand Down

0 comments on commit 0227168

Please sign in to comment.