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:
parent
223675bafb
commit
d7576d223d
1 changed files with 11 additions and 1 deletions
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue