Skip to content

Commit

Permalink
Merge pull request #49039 from wildan-m/wildan/fix/47799-loading-behi…
Browse files Browse the repository at this point in the history
…nd-background

Fix loading skeleton behind background
  • Loading branch information
carlosmiceli authored Sep 14, 2024
2 parents 49b4b83 + b8daafb commit 51a64cf
Showing 1 changed file with 7 additions and 3 deletions.
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);

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

0 comments on commit 51a64cf

Please sign in to comment.