Skip to content

Commit

Permalink
complete resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Apr 1, 2024
1 parent 8db0d5c commit a588842
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5064,48 +5064,6 @@ function setShownHoldUseExplanation() {
Onyx.set(ONYXKEYS.NVP_HOLD_USE_EXPLAINED, true);
}

<<<<<<< HEAD
=======
/** Navigates to the next IOU page based on where the IOU request was started */
function navigateToNextPage(iou: OnyxEntry<OnyxTypes.IOU>, iouType: string, report?: OnyxEntry<OnyxTypes.Report>, path = '') {
const moneyRequestID = `${iouType}${report?.reportID ?? ''}`;
const shouldReset = iou?.id !== moneyRequestID && !!report?.reportID;

// If the money request ID in Onyx does not match the ID from params, we want to start a new request
// with the ID from params. We need to clear the participants in case the new request is initiated from FAB.
if (shouldReset) {
resetMoneyRequestInfo(moneyRequestID);
}

// If we're adding a receipt, that means the user came from the confirmation page and we need to navigate back to it.
if (path.slice(1) === ROUTES.MONEY_REQUEST_RECEIPT.getRoute(iouType, report?.reportID)) {
Navigation.navigate(
ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(CONST.IOU.ACTION.CREATE, iouType as ValueOf<typeof CONST.IOU.TYPE>, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, report?.reportID ?? '1'),
);
return;
}

// If a request is initiated on a report, skip the participants selection step and navigate to the confirmation page.
if (report?.reportID) {
// If the report is iou or expense report, we should get the chat report to set participant for request money
const chatReport = ReportUtils.isMoneyRequestReport(report) ? ReportUtils.getReport(report.chatReportID) : report;
// Reinitialize the participants when the money request ID in Onyx does not match the ID from params
if (!iou?.participants?.length || shouldReset) {
const currentUserAccountID = currentUserPersonalDetails.accountID;
const participants: Participant[] = ReportUtils.isPolicyExpenseChat(chatReport)
? [{reportID: chatReport?.reportID, isPolicyExpenseChat: true, selected: true}]
: (chatReport?.participantAccountIDs ?? []).filter((accountID) => currentUserAccountID !== accountID).map((accountID) => ({accountID, selected: true}));
setMoneyRequestParticipants(participants);
}
Navigation.navigate(
ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(CONST.IOU.ACTION.CREATE, iouType as ValueOf<typeof CONST.IOU.TYPE>, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, report.reportID),
);
return;
}
Navigation.navigate(ROUTES.MONEY_REQUEST_PARTICIPANTS.getRoute(iouType));
}

>>>>>>> main
/**
* Put money request on HOLD
*/
Expand Down

0 comments on commit a588842

Please sign in to comment.