Skip to content

Commit

Permalink
fix resetting IOU on new request
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg committed Aug 2, 2023
1 parent f462336 commit 8558d74
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ Onyx.connect({
/**
* Reset money request info from the store with its initial value
* @param {String} id
* @returns {Promise}
*/
function resetMoneyRequestInfo(id = '') {
Onyx.merge(ONYXKEYS.IOU, {
return Onyx.merge(ONYXKEYS.IOU, {
id,
amount: 0,
currency: lodashGet(currentUserPersonalDetails, 'localCurrencyCode', CONST.CURRENCY.USD),
Expand Down Expand Up @@ -1439,8 +1440,9 @@ function payMoneyRequest(paymentType, chatReport, iouReport) {
* @param {String} reportID
*/
function startMoneyRequest(iouType, reportID = '') {
resetMoneyRequestInfo(`${iouType}${reportID}`);
Navigation.navigate(ROUTES.getMoneyRequestRoute(iouType, reportID));
resetMoneyRequestInfo(`${iouType}${reportID}`).then(() => {
Navigation.navigate(ROUTES.getMoneyRequestRoute(iouType, reportID));
});
}

/**
Expand Down

0 comments on commit 8558d74

Please sign in to comment.