Make permalinks to the same event work more than once (#34483)

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
hayyaksi
2026-08-05 13:37:22 +03:00
committed by GitHub
parent 97851e6463
commit c8f75a4f7c
2 changed files with 32 additions and 2 deletions
@@ -341,8 +341,12 @@ class TimelinePanel extends React.Component<IProps, IState> {
const differentEventId = prevProps.eventId != this.props.eventId;
const differentHighlightedEventId = prevProps.highlightedEventId != this.props.highlightedEventId;
const differentAvoidJump = prevProps.eventScrollIntoView && !this.props.eventScrollIntoView;
if (differentEventId || differentHighlightedEventId || differentAvoidJump) {
// Both directions matter. The flag is cleared once a jump has landed, so clicking the same
// permalink again flips it back to true and has to jump afresh. An unset prop means true,
// matching the default in loadTimeline.
const differentScrollIntoView =
(prevProps.eventScrollIntoView ?? true) !== (this.props.eventScrollIntoView ?? true);
if (differentEventId || differentHighlightedEventId || differentScrollIntoView) {
logger.log(
`TimelinePanel switching to eventId ${this.props.eventId} (was ${prevProps.eventId}), ` +
`scrollIntoView: ${this.props.eventScrollIntoView} (was ${prevProps.eventScrollIntoView})`,