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.
This commit is contained in:
Richard van der Hoff 2016-02-03 15:34:20 +00:00
parent 223675bafb
commit d7576d223d

View file

@ -995,8 +995,18 @@ module.exports = React.createClass({
var eventId = mxEv.getId(); var eventId = mxEv.getId();
var highlight = (eventId == this.props.highlightedEventId); 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( 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} <EventTile mxEvent={mxEv} continuation={continuation}
last={last} isSelectedEvent={highlight}/> last={last} isSelectedEvent={highlight}/>
</li> </li>