From 1ba579b0a181fbfff514ef32b50179d2ab1fc342 Mon Sep 17 00:00:00 2001 From: diondiondion Date: Thu, 23 Oct 2025 17:52:07 +0200 Subject: [PATCH] Fix "new post highlighting" in threads being applied when navigating between posts (#36583) --- app/javascript/mastodon/features/status/index.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/features/status/index.jsx b/app/javascript/mastodon/features/status/index.jsx index a07b20f027e..bcccc11044a 100644 --- a/app/javascript/mastodon/features/status/index.jsx +++ b/app/javascript/mastodon/features/status/index.jsx @@ -504,12 +504,14 @@ class Status extends ImmutablePureComponent { componentDidUpdate (prevProps) { const { status, ancestorsIds, descendantsIds } = this.props; - if (status && (ancestorsIds.length > prevProps.ancestorsIds.length || prevProps.status?.get('id') !== status.get('id'))) { + const isSameStatus = status && (prevProps.status?.get('id') === status.get('id')); + + if (status && (ancestorsIds.length > prevProps.ancestorsIds.length || !isSameStatus)) { this._scrollStatusIntoView(); } // Only highlight replies after the initial load - if (prevProps.descendantsIds.length) { + if (prevProps.descendantsIds.length && isSameStatus) { const newRepliesIds = difference(descendantsIds, prevProps.descendantsIds); if (newRepliesIds.length) {