Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loading skeleton behind background #49039

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);
wildan-m marked this conversation as resolved.
Show resolved Hide resolved
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
Loading