Skip to content

Commit dc0e6e0

Browse files
authored
Merge pull request Expensify#75726 from Eskalifer1/fix/73728
Delay navigation to confirmation page after participant select
2 parents d7aa38b + 18e2e53 commit dc0e6e0

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/pages/iou/request/step/IOURequestStepParticipants.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ function IOURequestStepParticipants({
202202
// We don't want to compare params because we just changed the participants.
203203
Navigation.goBack(iouConfirmationPageRoute, {compareParams: false});
204204
} else {
205-
Navigation.navigate(iouConfirmationPageRoute);
205+
// We wrap navigation in setNavigationActionToMicrotaskQueue so that data loading in Onyx and navigation do not occur simultaneously, which resets the amount to 0.
206+
// More information can be found here: https://github.com/Expensify/App/issues/73728
207+
Navigation.setNavigationActionToMicrotaskQueue(() => {
208+
Navigation.navigate(iouConfirmationPageRoute);
209+
});
206210
}
207211
});
208212
}, [selfDMReportID, transactions, action, initialTransactionID, waitForKeyboardDismiss, iouType, selfDMReport, isActivePolicyRequest, backTo]);
@@ -355,7 +359,11 @@ function IOURequestStepParticipants({
355359
// We don't want to compare params because we just changed the participants.
356360
Navigation.goBack(route, {compareParams: false});
357361
} else {
358-
Navigation.navigate(route);
362+
// We wrap navigation in setNavigationActionToMicrotaskQueue so that data loading in Onyx and navigation do not occur simultaneously, which resets the amount to 0.
363+
// More information can be found here: https://github.com/Expensify/App/issues/73728
364+
Navigation.setNavigationActionToMicrotaskQueue(() => {
365+
Navigation.navigate(route);
366+
});
359367
}
360368
});
361369
}, [action, participants, iouType, initialTransaction, transactions, initialTransactionID, reportID, waitForKeyboardDismiss, isMovingTransactionFromTrackExpense, backTo, introSelected]);

0 commit comments

Comments
 (0)