From 03451d8c7d6404ba2dacdcc75d4cfb2459cd32d8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 8 Jul 2015 19:47:58 +0100 Subject: [PATCH] Sort rooms for prev/next purposes --- src/controllers/pages/MatrixChat.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controllers/pages/MatrixChat.js b/src/controllers/pages/MatrixChat.js index fe126e50..717f91e7 100644 --- a/src/controllers/pages/MatrixChat.js +++ b/src/controllers/pages/MatrixChat.js @@ -80,7 +80,9 @@ module.exports = { case 'view_prev_room': roomIndexDelta = -1; case 'view_next_room': - var allRooms = MatrixClientPeg.get().getRooms(); + var allRooms = RoomListSorter.mostRecentActivityFirst( + MatrixClientPeg.get().getRooms() + ); var roomIndex = -1; for (var i = 0; i < allRooms.length; ++i) { if (allRooms[i].roomId == this.state.currentRoom) {