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
Richard van der Hoff 2016-02-03 15:34:20 +00:00
parent 223675bafb
commit d7576d223d
1 changed files with 11 additions and 1 deletions

View File

@ -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>