diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index c30a8c7ed4a8..635be1fc77c5 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -105,7 +105,7 @@ const defaultProps = { hasOutstandingIOU: false, }, reportMetadata: { - isLoadingReportActions: false, + isLoadingReportActions: true, isLoadingMoreReportActions: false, }, isComposerFullSize: false, @@ -118,15 +118,6 @@ const defaultProps = { ...withCurrentReportIDDefaultProps, }; -/** - * - * Function to check weather the report available in props is default - * - * @param {Object} report - * @returns {Boolean} - */ -const checkDefaultReport = (report) => report === defaultProps.report; - /** * Get the currently viewed report ID as number * @@ -188,8 +179,6 @@ function ReportScreen({ const isTopMostReportId = currentReportID === getReportID(route); const didSubscribeToReportLeavingEvents = useRef(false); - const isDefaultReport = checkDefaultReport(report); - let headerView = ( { setIsBannerVisible(false); @@ -364,17 +354,8 @@ function ReportScreen({ // eslint-disable-next-line rulesdir/no-negated-variables const shouldShowNotFoundPage = useMemo( - () => - (!firstRenderRef.current && - !_.isEmpty(report) && - !isDefaultReport && - !report.reportID && - !isOptimisticDelete && - !report.isLoadingReportActions && - !isLoading && - !userLeavingStatus) || - shouldHideReport, - [report, isLoading, shouldHideReport, isDefaultReport, isOptimisticDelete, userLeavingStatus], + () => (!firstRenderRef.current && !report.reportID && !isOptimisticDelete && !reportMetadata.isLoadingReportActions && !isLoading && !userLeavingStatus) || shouldHideReport, + [report, reportMetadata, isLoading, shouldHideReport, isOptimisticDelete, userLeavingStatus], ); return ( @@ -486,7 +467,7 @@ export default compose( reportMetadata: { key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT_METADATA}${getReportID(route)}`, initialValue: { - isLoadingReportActions: false, + isLoadingReportActions: true, isLoadingMoreReportActions: false, }, },