diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 94089f880c92..fc2cd961affd 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -402,12 +402,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing const isLoading = isLoadingApp || !reportIDFromRoute || (!isSidebarLoaded && !isInNarrowPaneModal) || PersonalDetailsUtils.isPersonalDetailsEmpty(); const shouldShowSkeleton = - (isLinkingToMessage && !isLinkedMessagePageReady) || - (!!reportActionIDFromRoute && !!reportMetadata?.isLoadingInitialReportActions) || - (!isLinkingToMessage && !isInitialPageReady) || - isLoadingReportOnyx || - !isCurrentReportLoadedFromOnyx || - isLoading; + (isLinkingToMessage && !isLinkedMessagePageReady) || (!isLinkingToMessage && !isInitialPageReady) || isLoadingReportOnyx || !isCurrentReportLoadedFromOnyx || isLoading; // eslint-disable-next-line rulesdir/no-negated-variables const shouldShowNotFoundLinkedAction = @@ -788,7 +783,6 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro hasLoadingNewerReportActionsError={reportMetadata?.hasLoadingNewerReportActionsError} isLoadingOlderReportActions={reportMetadata?.isLoadingOlderReportActions} hasLoadingOlderReportActionsError={reportMetadata?.hasLoadingOlderReportActionsError} - isReadyForCommentLinking={!shouldShowSkeleton} transactionThreadReportID={transactionThreadReportID} /> )} diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index fb99f8508f6f..b4bcfea4fdcf 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -71,9 +71,6 @@ type ReportActionsViewProps = ReportActionsViewOnyxProps & { /** There an error when loading newer report actions */ hasLoadingNewerReportActionsError?: boolean; - /** Whether the report is ready for comment linking */ - isReadyForCommentLinking?: boolean; - /** The reportID of the transaction thread report associated with this current report, if any */ // eslint-disable-next-line react/no-unused-prop-types transactionThreadReportID?: string | null; @@ -96,7 +93,6 @@ function ReportActionsView({ hasLoadingOlderReportActionsError = false, isLoadingNewerReportActions = false, hasLoadingNewerReportActionsError = false, - isReadyForCommentLinking = false, transactionThreadReportID, }: ReportActionsViewProps) { useCopySelectionHelper(); @@ -122,7 +118,6 @@ function ReportActionsView({ const [isNavigatingToLinkedMessage, setNavigatingToLinkedMessage] = useState(!!reportActionID); const prevShouldUseNarrowLayoutRef = useRef(shouldUseNarrowLayout); const reportID = report.reportID; - const isLoading = (!!reportActionID && isLoadingInitialReportActions) || !isReadyForCommentLinking; const isReportFullyVisible = useMemo((): boolean => getIsReportFullyVisible(isFocused), [isFocused]); const openReportIfNecessary = () => { if (!shouldFetchReport(report)) { @@ -156,7 +151,7 @@ function ReportActionsView({ listOldID = newID; return newID; // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - }, [route, isLoadingInitialReportActions, reportActionID]); + }, [route, reportActionID]); // When we are offline before opening an IOU/Expense report, // the total of the report and sometimes the expense aren't displayed because these actions aren't returned until `OpenReport` API is complete. @@ -244,7 +239,7 @@ function ReportActionsView({ if (!reportActionID) { return combinedReportActions; } - if (isLoading || indexOfLinkedAction === -1) { + if (indexOfLinkedAction === -1) { return []; } @@ -256,7 +251,7 @@ function ReportActionsView({ // currentReportActionID is needed to trigger batching once the report action has been positioned // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - }, [reportActionID, combinedReportActions, indexOfLinkedAction, isLoading, currentReportActionID]); + }, [reportActionID, combinedReportActions, indexOfLinkedAction, currentReportActionID]); const reportActionIDMap = useMemo(() => { const reportActionIDs = allReportActions.map((action) => action.reportActionID); @@ -404,7 +399,7 @@ function ReportActionsView({ !force && (!reportActionID || !isFocused || - isLoadingInitialReportActions || + (isLoadingInitialReportActions && !hasMoreCached) || isLoadingNewerReportActions || // If there was an error only try again once on initial mount. We should also still load // more in case we have cached messages. @@ -523,9 +518,6 @@ function arePropsEqual(oldProps: ReportActionsViewProps, newProps: ReportActions return false; } - if (!lodashIsEqual(oldProps.isReadyForCommentLinking, newProps.isReadyForCommentLinking)) { - return false; - } if (!lodashIsEqual(oldProps.reportActions, newProps.reportActions)) { return false; }