Fix local echo comment for scroll tokens

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
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
1 changed files with 2 additions and 2 deletions

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 }),