From d7576d223dc87155e2df29767444f7cf5fe6bbe4 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 3 Feb 2016 15:34:20 +0000 Subject: [PATCH] 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. --- src/components/structures/RoomView.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index c46149bfeb..09b6baf2be 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -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( -
  • +