From 55cb5fc9c6b10fec4812117ce63a4c4ad6665d02 Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Tue, 8 Oct 2024 16:13:48 +0200 Subject: [PATCH 1/2] fix not showing iou details after deleting expense --- src/pages/home/report/ReportActionsView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index 8f4395fdb715..f4b1a54429cd 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -463,7 +463,7 @@ function ReportActionsView({ } // AutoScroll is disabled when we do linking to a specific reportAction - const shouldEnableAutoScroll = hasNewestReportAction && (!reportActionID || !isNavigatingToLinkedMessage); + const shouldEnableAutoScroll = (hasNewestReportAction && (!reportActionID || !isNavigatingToLinkedMessage)) || reportActions.length === 1; return ( <> Date: Thu, 10 Oct 2024 16:47:21 +0200 Subject: [PATCH 2/2] fix: changed condition --- src/pages/home/report/ReportActionsView.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index c9407536461f..8896611905ca 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -93,6 +93,7 @@ function ReportActionsView({ selector: (reportActions: OnyxEntry) => ReportActionsUtils.getSortedReportActionsForDisplay(reportActions, true), }); const [transactionThreadReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID ?? -1}`); + const prevTransactionThreadReport = usePrevious(transactionThreadReport); const reportActionID = route?.params?.reportActionID; const prevReportActionID = usePrevious(reportActionID); const didLayout = useRef(false); @@ -470,7 +471,7 @@ function ReportActionsView({ } // AutoScroll is disabled when we do linking to a specific reportAction - const shouldEnableAutoScroll = (hasNewestReportAction && (!reportActionID || !isNavigatingToLinkedMessage)) || reportActions.length === 1; + const shouldEnableAutoScroll = (hasNewestReportAction && (!reportActionID || !isNavigatingToLinkedMessage)) || (transactionThreadReport && !prevTransactionThreadReport); return ( <>