Skip to content
Merged
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
12 changes: 11 additions & 1 deletion src/components/ReportActionItem/MoneyRequestReceiptView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@

const [showConfirmDismissReceiptError, setShowConfirmDismissReceiptError] = useState(false);

const transactionAndReportActionErrors = useMemo(
() => ({
...transaction?.errors,
...parentReportAction?.errors,
}),
[transaction?.errors, parentReportAction?.errors],
);

const dismissReceiptError = useCallback(() => {
if (!report?.reportID) {
return;
Expand All @@ -227,8 +235,10 @@
clearAllRelatedReportActionErrors(report.reportID, parentReportAction);
return;
}
if (!isEmptyObject(errorsWithoutReportCreation)) {
if (!isEmptyObject(transactionAndReportActionErrors)) {
revert(transaction, getLastModifiedExpense(report?.reportID));
}
if (!isEmptyObject(errorsWithoutReportCreation)) {
clearError(transaction.transactionID);
clearAllRelatedReportActionErrors(report.reportID, parentReportAction);
}
Expand All @@ -238,7 +248,7 @@
}
navigateToConciergeChatAndDeleteReport(report.reportID, true, true);
}
}, [

Check warning on line 251 in src/components/ReportActionItem/MoneyRequestReceiptView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useCallback has a missing dependency: 'transactionAndReportActionErrors'. Either include it or remove the dependency array

Check warning on line 251 in src/components/ReportActionItem/MoneyRequestReceiptView.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useCallback has a missing dependency: 'transactionAndReportActionErrors'. Either include it or remove the dependency array
transaction,
chatReport,
parentReportAction,
Expand Down
Loading