Merge pull request #1704 from matrix-org/luke/perf-room-list

Only set selected tags state when updating rooms
pull/21833/head
David Baker 2018-01-15 15:01:57 +00:00 committed by GitHub
commit 0a6018a945
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -324,12 +324,7 @@ module.exports = React.createClass({
// Show all rooms // Show all rooms
this._visibleRooms = MatrixClientPeg.get().getRooms(); this._visibleRooms = MatrixClientPeg.get().getRooms();
} }
this._delayedRefreshRoomList();
this.setState({
selectedTags,
}, () => {
this.refreshRoomList();
});
}, },
refreshRoomList: function() { refreshRoomList: function() {
@ -345,6 +340,9 @@ module.exports = React.createClass({
this.setState({ this.setState({
lists: this.getRoomLists(), lists: this.getRoomLists(),
totalRoomCount: totalRooms, totalRoomCount: totalRooms,
// Do this here so as to not render every time the selected tags
// themselves change.
selectedTags: TagOrderStore.getSelectedTags(),
}); });
// this._lastRefreshRoomListTs = Date.now(); // this._lastRefreshRoomListTs = Date.now();