diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 4690e2ca284d..429b3a9cb34f 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -7215,7 +7215,15 @@ function payInvoice(paymentMethodType: PaymentMethodType, chatReport: OnyxTypes. function detachReceipt(transactionID: string) { const transaction = allTransactions[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]; - const newTransaction = transaction ? {...transaction, filename: '', receipt: {}} : null; + const newTransaction = transaction + ? { + ...transaction, + filename: '', + receipt: { + source: '', + }, + } + : null; const optimisticData: OnyxUpdate[] = [ { diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 6535d35c55f9..945e6570fab8 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -558,7 +558,14 @@ function ReportScreen({ // If a user has chosen to leave a thread, and then returns to it (e.g. with the back button), we need to call `openReport` again in order to allow the user to rejoin and to receive real-time updates useEffect(() => { - if (!shouldUseNarrowLayout || !isFocused || prevIsFocused || !ReportUtils.isChatThread(report) || report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) { + if ( + !shouldUseNarrowLayout || + !isFocused || + prevIsFocused || + !ReportUtils.isChatThread(report) || + report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN || + isSingleTransactionView + ) { return; } Report.openReport(report.reportID); @@ -566,7 +573,7 @@ function ReportScreen({ // We don't want to run this useEffect every time `report` is changed // Excluding shouldUseNarrowLayout from the dependency list to prevent re-triggering on screen resize events. // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - }, [prevIsFocused, report.notificationPreference, isFocused]); + }, [prevIsFocused, report.notificationPreference, isFocused, isSingleTransactionView]); useEffect(() => { // We don't want this effect to run on the first render.