@@ -9967,11 +9967,11 @@ function canUserPerformWriteAction(report: OnyxEntry<Report>, isReportArchived:
99679967/**
99689968 * Returns ID of the original report from which the given reportAction is first created.
99699969 */
9970- function getOriginalReportID(reportID: string | undefined, reportAction: OnyxInputOrEntry<ReportAction>): string | undefined {
9970+ function getOriginalReportID(reportID: string | undefined, reportAction: OnyxInputOrEntry<ReportAction>, reportActionsParam: OnyxEntry<ReportActions> | undefined ): string | undefined {
99719971 if (!reportID) {
99729972 return undefined;
99739973 }
9974- const reportActions = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`];
9974+ const reportActions = reportActionsParam ?? allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`];
99759975 const currentReportAction = reportAction?.reportActionID ? reportActions?.[reportAction.reportActionID] : undefined;
99769976 const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
99779977 const chatReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report?.chatReportID}`];
@@ -10814,16 +10814,6 @@ function getIndicatedMissingPaymentMethod(
1081410814 return !hasCreditBankAccount(bankAccountList) ? 'bankAccount' : undefined;
1081510815}
1081610816
10817- /**
10818- * Checks if report chat contains missing payment method
10819- */
10820- function hasMissingPaymentMethod(userWalletTierName: string | undefined, iouReportID: string | undefined, bankAccountList: OnyxEntry<BankAccountList>): boolean {
10821- const reportActions = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReportID}`] ?? {};
10822- return Object.values(reportActions)
10823- .filter(Boolean)
10824- .some((action) => getIndicatedMissingPaymentMethod(userWalletTierName, iouReportID, action, bankAccountList) !== undefined);
10825- }
10826-
1082710817/**
1082810818 * Used from expense actions to decide if we need to build an optimistic expense report.
1082910819 * Create a new report if:
@@ -12946,7 +12936,6 @@ export {
1294612936 hasExpensifyGuidesEmails,
1294712937 hasHeldExpenses,
1294812938 hasIOUWaitingOnCurrentUserBankAccount,
12949- hasMissingPaymentMethod,
1295012939 hasNonReimbursableTransactions,
1295112940 hasOnlyHeldExpenses,
1295212941 hasOnlyTransactionsWithPendingRoutes,
0 commit comments