Skip to content

Commit

Permalink
fix: changed condition
Browse files Browse the repository at this point in the history
  • Loading branch information
kubabutkiewicz committed Oct 10, 2024
1 parent e267ed0 commit 650ef52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/home/report/ReportActionsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ function ReportActionsView({
selector: (reportActions: OnyxEntry<OnyxTypes.ReportActions>) => 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);
Expand Down Expand Up @@ -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 (
<>
<ReportActionsList
Expand Down

0 comments on commit 650ef52

Please sign in to comment.