From 1fe85f37fdc3fe7f7bec90c3553cbd3227ec3c70 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Tue, 6 Sep 2016 11:34:38 +0100 Subject: [PATCH] Correct AddressTile and ChatInviteDialog styling, and performance tweak to searching --- src/components/views/dialogs/ChatInviteDialog.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index 92aeaf34eb..5c3b5bbbc8 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -90,7 +90,14 @@ module.exports = React.createClass({ onQueryChanged: function(ev) { var query = ev.target.value; - var queryList = this._userList.filter((user) => { + var list; + // Use the already filtered list if it has been filtered + if (query.length > 1) { + list = this.state.queryList; + } else { + list = this._userList; + } + var queryList = list.filter((user) => { return this._matches(query, user); }); this.setState({ queryList: queryList }); @@ -187,10 +194,10 @@ module.exports = React.createClass({
- +
-
{ query }
+
{ query }