mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-12-06 12:39:01 +00:00
Make permalinks to the same event work more than once (#34483)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -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})`,
|
||||
|
||||
Reference in New Issue
Block a user