From f1d72296b76e87d28753281ef6d1a8d481ef8a4c Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 14 Jul 2016 14:06:31 +0100 Subject: [PATCH] Fix last-spoke order Turns out this timeline is the other way around, so loop through the other way --- src/TabCompleteEntries.js | 3 +-- src/components/structures/RoomView.js | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/TabCompleteEntries.js b/src/TabCompleteEntries.js index 3cfe07c7c0..419b3d7942 100644 --- a/src/TabCompleteEntries.js +++ b/src/TabCompleteEntries.js @@ -118,8 +118,7 @@ MemberEntry.fromMemberList = function(room, members) { // each member last spoke const lastSpoke = {}; const timelineEvents = room.getLiveTimeline().getEvents(); - for (var i = timelineEvents.length - 1; i >= 0; --i) { - const ev = timelineEvents[i]; + for (const ev of room.getLiveTimeline().getEvents()) { lastSpoke[ev.getSender()] = ev.getTs(); } diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 64a29f9ffc..71edbf162d 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -360,6 +360,10 @@ module.exports = React.createClass({ }); } } + + // update ther tab complete list as it depends on who most recently spoke, + // and that has probably just changed + this._updateTabCompleteList(); }, // called when state.room is first initialised (either at initial load,