From ffbd94cda46c09d41493626b7525be6109c1ea24 Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Wed, 19 Nov 2025 11:11:02 -0800 Subject: [PATCH] Revert "Prevent making redundant API call when report is not loaded" --- src/pages/home/report/ReportActionsList.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index 5f5a69ca54157..c0c4068c8c3b6 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -193,7 +193,6 @@ function ReportActionsList({ const isTryNewDotNVPDismissed = !!tryNewDot?.classicRedirect?.dismissed; const [isScrollToBottomEnabled, setIsScrollToBottomEnabled] = useState(false); const [actionIdToHighlight, setActionIdToHighlight] = useState(''); - const [reportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report.reportID}`, {canBeMissing: true}); const backTo = route?.params?.backTo as string; // Display the new message indicator when comment linking and not close to the newest message. @@ -406,11 +405,6 @@ function ReportActionsList({ return; } - // Do not try to mark the report as read if the report has not been loaded and shared with the user - if (!reportMetadata?.hasOnceLoadedReportActions) { - return; - } - if (isUnread(report, transactionThreadReport, isReportArchived) || (lastAction && isCurrentActionUnread(report, lastAction, sortedVisibleReportActions))) { // On desktop, when the notification center is displayed, isVisible will return false. // Currently, there's no programmatic way to dismiss the notification center panel. @@ -427,7 +421,7 @@ function ReportActionsList({ readActionSkipped.current = true; } // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - }, [report.lastVisibleActionCreated, transactionThreadReport?.lastVisibleActionCreated, report.reportID, isVisible, reportMetadata?.hasOnceLoadedReportActions]); + }, [report.lastVisibleActionCreated, transactionThreadReport?.lastVisibleActionCreated, report.reportID, isVisible]); const handleAppVisibilityMarkAsRead = useCallback(() => { if (report.reportID !== prevReportID) {