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

chore: revert pull 27369 changes #28117

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ function resetMoneyRequestInfo(id = '') {
amount: 0,
currency: lodashGet(currentUserPersonalDetails, 'localCurrencyCode', CONST.CURRENCY.USD),
comment: '',
// TODO: remove participants after all instances of iou.participants will be replaced with iou.participantAccountIDs
participants: [],
participantAccountIDs: [],
merchant: CONST.TRANSACTION.DEFAULT_MERCHANT,
category: '',
tag: '',
Expand Down Expand Up @@ -2049,9 +2047,7 @@ function setMoneyRequestBillable(billable) {
* @param {Object[]} participants
*/
function setMoneyRequestParticipants(participants) {
// TODO: temporarily we want to save both participants and participantAccountIDs, then we can remove participants (and rename the function)
// more info: https://github.com/Expensify/App/issues/25714#issuecomment-1712924903 and https://github.com/Expensify/App/issues/25714#issuecomment-1716335802
Onyx.merge(ONYXKEYS.IOU, {participants, participantAccountIDs: _.map(participants, 'accountID')});
Onyx.merge(ONYXKEYS.IOU, {participants});
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/MoneyRequestDatePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ function MoneyRequestDatePage({iou, route, selectedTab}) {
IOU.resetMoneyRequestInfo(moneyRequestId);
}

if (!isDistanceRequest && (_.isEmpty(iou.participantAccountIDs) || (iou.amount === 0 && !iou.receiptPath) || shouldReset)) {
if (!isDistanceRequest && (_.isEmpty(iou.participants) || (iou.amount === 0 && !iou.receiptPath) || shouldReset)) {
Navigation.goBack(ROUTES.MONEY_REQUEST.getRoute(iouType, reportID), true);
}
}, [iou.id, iou.participantAccountIDs, iou.amount, iou.receiptPath, iouType, reportID, isDistanceRequest]);
}, [iou.id, iou.participants, iou.amount, iou.receiptPath, iouType, reportID, isDistanceRequest]);

function navigateBack() {
Navigation.goBack(ROUTES.MONEY_REQUEST_CONFIRMATION.getRoute(iouType, reportID));
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/MoneyRequestDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ function MoneyRequestDescriptionPage({iou, route, selectedTab}) {
IOU.resetMoneyRequestInfo(moneyRequestId);
}

if (!isDistanceRequest && (_.isEmpty(iou.participantAccountIDs) || (iou.amount === 0 && !iou.receiptPath) || shouldReset)) {
if (!isDistanceRequest && (_.isEmpty(iou.participants) || (iou.amount === 0 && !iou.receiptPath) || shouldReset)) {
Navigation.goBack(ROUTES.MONEY_REQUEST.getRoute(iouType, reportID), true);
}
}, [iou.id, iou.participantAccountIDs, iou.amount, iou.receiptPath, iouType, reportID, isDistanceRequest]);
}, [iou.id, iou.participants, iou.amount, iou.receiptPath, iouType, reportID, isDistanceRequest]);

function navigateBack() {
Navigation.goBack(ROUTES.MONEY_REQUEST_CONFIRMATION.getRoute(iouType, reportID));
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/MoneyRequestMerchantPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ function MoneyRequestMerchantPage({iou, route}) {
IOU.resetMoneyRequestInfo(moneyRequestId);
}

if (_.isEmpty(iou.participantAccountIDs) || (iou.amount === 0 && !iou.receiptPath) || shouldReset) {
if (_.isEmpty(iou.participants) || (iou.amount === 0 && !iou.receiptPath) || shouldReset) {
Navigation.goBack(ROUTES.MONEY_REQUEST.getRoute(iouType, reportID), true);
}
}, [iou.id, iou.participantAccountIDs, iou.amount, iou.receiptPath, iouType, reportID]);
}, [iou.id, iou.participants, iou.amount, iou.receiptPath, iouType, reportID]);

function navigateBack() {
Navigation.goBack(ROUTES.MONEY_REQUEST_CONFIRMATION.getRoute(iouType, reportID));
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/steps/NewRequestAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ function NewRequestAmountPage({route, iou, report, selectedTab}) {
IOU.resetMoneyRequestInfo(moneyRequestID);
}

if (!isDistanceRequestTab && (_.isEmpty(iou.participantAccountIDs) || iou.amount === 0 || shouldReset)) {
if (!isDistanceRequestTab && (_.isEmpty(iou.participants) || iou.amount === 0 || shouldReset)) {
Navigation.goBack(ROUTES.MONEY_REQUEST.getRoute(iouType, reportID), true);
}
}

return () => {
prevMoneyRequestID.current = iou.id;
};
}, [iou.participantAccountIDs, iou.amount, iou.id, isEditing, iouType, reportID, isDistanceRequestTab]);
}, [iou.participants, iou.amount, iou.id, isEditing, iouType, reportID, isDistanceRequestTab]);

const navigateBack = () => {
Navigation.goBack(isEditing ? ROUTES.MONEY_REQUEST_CONFIRMATION.getRoute(iouType, reportID) : ROUTES.HOME);
Expand Down
Loading