From 534f9277d436e66725a7f8875d88d78f7cf59f02 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 8 May 2017 15:37:40 +0100 Subject: [PATCH 1/2] Fix this/self fail in LeftPanel --- src/components/views/dialogs/ChatInviteDialog.js | 5 +++++ src/components/views/rooms/RoomList.js | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index 7ba503099a..b349b94e5d 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -191,6 +191,7 @@ module.exports = React.createClass({ this.queryChangedDebouncer = setTimeout(() => { // Only do search if there is something to search if (query.length > 0 && query != '@') { + performance.mark('start'); // Weighted keys prefer to match userIds when first char is @ this._fuse.options.keys = [{ name: 'displayName', @@ -199,6 +200,7 @@ module.exports = React.createClass({ name: 'userId', weight: query[0] === '@' ? 0.9 : 0.1, }]; + performance.mark('middle'); queryList = this._fuse.search(query).map((user) => { // Return objects, structure of which is defined // by InviteAddressType @@ -210,6 +212,9 @@ module.exports = React.createClass({ isKnown: true, } }); + performance.mark('end'); + performance.measure('setopts', 'start', 'middle'); + performance.measure('search', 'middle', 'end'); // If the query is a valid address, add an entry for that // This is important, otherwise there's no way to invite diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 8d396b5536..a595a91ba9 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -652,7 +652,7 @@ module.exports = React.createClass({ Date: Mon, 8 May 2017 16:39:11 +0100 Subject: [PATCH 2/2] Revert unintentional change --- src/components/views/dialogs/ChatInviteDialog.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index b349b94e5d..7ba503099a 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -191,7 +191,6 @@ module.exports = React.createClass({ this.queryChangedDebouncer = setTimeout(() => { // Only do search if there is something to search if (query.length > 0 && query != '@') { - performance.mark('start'); // Weighted keys prefer to match userIds when first char is @ this._fuse.options.keys = [{ name: 'displayName', @@ -200,7 +199,6 @@ module.exports = React.createClass({ name: 'userId', weight: query[0] === '@' ? 0.9 : 0.1, }]; - performance.mark('middle'); queryList = this._fuse.search(query).map((user) => { // Return objects, structure of which is defined // by InviteAddressType @@ -212,9 +210,6 @@ module.exports = React.createClass({ isKnown: true, } }); - performance.mark('end'); - performance.measure('setopts', 'start', 'middle'); - performance.measure('search', 'middle', 'end'); // If the query is a valid address, add an entry for that // This is important, otherwise there's no way to invite