From edbf0e9f5b79e6330947833f93f086882827a40c Mon Sep 17 00:00:00 2001 From: thelullabyy Date: Tue, 29 Jul 2025 17:20:23 +0700 Subject: [PATCH] fix: expenses deleted cause blank report View --- src/pages/home/ReportScreen.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 16eec26fd8f0..0a8fdc8415ed 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -304,7 +304,9 @@ function ReportScreen({route, navigation}: ReportScreenProps) { [reportTransactions, isOffline], ); const reportTransactionIDs = useMemo(() => visibleTransactions?.map((transaction) => transaction.transactionID), [visibleTransactions]); + const transactionThreadReportID = getOneTransactionThreadReportID(report, chatReport, reportActions ?? [], isOffline, reportTransactionIDs); + const [transactionThreadReportActions = getEmptyObject()] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`, { canBeMissing: true, }); @@ -496,6 +498,15 @@ function ReportScreen({route, navigation}: ReportScreenProps) { reportActionIDFromRoute, ]); + const prevTransactionThreadReportID = usePrevious(transactionThreadReportID); + useEffect(() => { + if (!!prevTransactionThreadReportID || !transactionThreadReportID) { + return; + } + + fetchReport(); + }, [fetchReport, prevTransactionThreadReportID, transactionThreadReportID]); + useEffect(() => { if (!reportID || !isFocused) { return;