mirror of https://github.com/vector-im/riot-web
Don't try to use local echoes as scroll tokens
Local echoes don't have a (usable) event id, so don't use them when remembering the scroll state of a room.pull/21833/head
parent
223675bafb
commit
d7576d223d
|
@ -995,8 +995,18 @@ module.exports = React.createClass({
|
|||
|
||||
var eventId = mxEv.getId();
|
||||
var highlight = (eventId == this.props.highlightedEventId);
|
||||
|
||||
var scrollToken = eventId;
|
||||
// we can't use local echoes as scroll tokens, because their event
|
||||
// IDs change.
|
||||
if (mxEv.status) {
|
||||
scrollToken = undefined;
|
||||
}
|
||||
|
||||
ret.push(
|
||||
<li key={eventId} ref={this._collectEventNode.bind(this, eventId)} data-scroll-token={eventId}>
|
||||
<li key={eventId}
|
||||
ref={this._collectEventNode.bind(this, eventId)}
|
||||
data-scroll-token={scrollToken}>
|
||||
<EventTile mxEvent={mxEv} continuation={continuation}
|
||||
last={last} isSelectedEvent={highlight}/>
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue