Skip to content

Commit

Permalink
don't show not found page for track expense report
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Apr 2, 2024
1 parent 8bde6bb commit 99a31ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/TransactionReceiptPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ function TransactionReceipt({transaction, report, reportMetadata = {isLoadingIni
}, []);

const moneyRequestReportID = ReportUtils.isMoneyRequestReport(report) ? report?.reportID : report?.parentReportID;
const isTrackExpenseReport = ReportUtils.isTrackExpenseReport(report);

const shouldShowNotFoundPage = !isTrackExpenseReport && (moneyRequestReportID ?? '') !== transaction?.reportID;

Check failure on line 51 in src/pages/TransactionReceiptPage.tsx

View workflow job for this annotation

GitHub Actions / Run ESLint

Do not use negated variable names

return (
<AttachmentModal
Expand All @@ -61,7 +64,7 @@ function TransactionReceipt({transaction, report, reportMetadata = {isLoadingIni
Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report?.reportID ?? ''));
}}
isLoading={!transaction && reportMetadata?.isLoadingInitialReportActions}
shouldShowNotFoundPage={(moneyRequestReportID ?? '') !== transaction?.reportID}
shouldShowNotFoundPage={shouldShowNotFoundPage}
/>
);
}
Expand Down

0 comments on commit 99a31ff

Please sign in to comment.