2
0

Fix "new post highlighting" in threads being applied when navigating between posts (#36583)

This commit is contained in:
diondiondion
2025-10-23 17:52:07 +02:00
committed by GitHub
parent 6b2051b7b3
commit 1ba579b0a1

View File

@@ -504,12 +504,14 @@ class Status extends ImmutablePureComponent {
componentDidUpdate (prevProps) { componentDidUpdate (prevProps) {
const { status, ancestorsIds, descendantsIds } = this.props; 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(); this._scrollStatusIntoView();
} }
// Only highlight replies after the initial load // Only highlight replies after the initial load
if (prevProps.descendantsIds.length) { if (prevProps.descendantsIds.length && isSameStatus) {
const newRepliesIds = difference(descendantsIds, prevProps.descendantsIds); const newRepliesIds = difference(descendantsIds, prevProps.descendantsIds);
if (newRepliesIds.length) { if (newRepliesIds.length) {