From 04c9924ad62cccc332d8815afe23d90246669922 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 23 Mar 2016 09:49:22 +0000 Subject: [PATCH] Fix off-by-one error in read-marker advancing The fix to https://github.com/vector-im/vector-web/issues/1241 introduced an off-by-one error which meant we would show the RM before the last event in a room. We were actually winding the RM back one if the last message wasn't sent by us. --- src/components/structures/TimelinePanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index 7270a3ef4a..bf8fd29b82 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -392,7 +392,7 @@ var TimelinePanel = React.createClass({ // now think about advancing it var myUserId = MatrixClientPeg.get().credentials.userId; - for (; i < events.length; i++) { + for (i++; i < events.length; i++) { var ev = events[i]; if (!ev.sender || ev.sender.userId != myUserId) { break;