diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index a368aece25cf..71c11f29eae9 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -310,6 +310,7 @@ 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 [transactionThreadReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`, {canBeMissing: true}); const [transactionThreadReportActions = getEmptyObject()] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`, { @@ -522,6 +523,15 @@ function ReportScreen({route, navigation}: ReportScreenProps) { transactionThreadReportID, ]); + const prevTransactionThreadReportID = usePrevious(transactionThreadReportID); + useEffect(() => { + if (!!prevTransactionThreadReportID || !transactionThreadReportID) { + return; + } + + fetchReport(); + }, [fetchReport, prevTransactionThreadReportID, transactionThreadReportID]); + useEffect(() => { if (!reportID || !isFocused) { return;