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
10 changes: 7 additions & 3 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,11 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
// After creating the task report then navigating to task detail we don't have any report actions and the last read time is empty so We need to update the initial last read time when opening the task report detail.
Report.readNewestAction(report.reportID);
}, [report]);
const firstReportAction = reportActions[0];
const mostRecentReportAction = reportActions[0];
const shouldShowMostRecentReportAction =
!!mostRecentReportAction &&
!ReportActionsUtils.isActionOfType(mostRecentReportAction, CONST.REPORT.ACTIONS.TYPE.CREATED) &&
!ReportActionsUtils.isDeletedAction(mostRecentReportAction);
Comment on lines +723 to +726
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag doesn't check for one-expense/invoice reports and makes the preview to be displayed. As such, #49853 resulted.


const lastRoute = usePrevious(route);
const lastReportActionIDFromRoute = usePrevious(reportActionIDFromRoute);
Expand Down Expand Up @@ -801,9 +805,9 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
{shouldShowSkeleton && (
<>
<ReportActionsSkeletonView />
{!!firstReportAction && (
{shouldShowMostRecentReportAction && (
<ReportActionsListItemRenderer
reportAction={firstReportAction}
reportAction={mostRecentReportAction}
reportActions={reportActions}
parentReportAction={parentReportAction}
parentReportActionForTransactionThread={undefined}
Expand Down