Fix local echo comment for scroll tokens

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Germain 2021-06-07 12:37:11 +01:00 committed by GitHub
parent d111f4cbb1
commit ea6904ce2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -906,6 +906,8 @@ export default class EventTile extends React.Component<IProps, IState> {
permalink = this.props.permalinkCreator.forEvent(this.props.mxEvent.getId());
}
// we can't use local echoes as scroll tokens, because their event IDs change.
// Local echos have a send "status".
const scrollToken = this.props.mxEvent.status
? undefined
: this.props.mxEvent.getId();
@ -1153,8 +1155,6 @@ export default class EventTile extends React.Component<IProps, IState> {
"tabIndex": -1,
"aria-live": ariaLive,
"aria-atomic": "true",
// we can't use local echoes as scroll tokens, because their event IDs change.
// Local echos have a send "status".
"data-scroll-tokens": scrollToken,
"onMouseEnter": () => this.setState({ hover: true }),
"onMouseLeave": () => this.setState({ hover: false }),