From a0004399480cffcab14377534ce5f47743bf7b55 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 14 Oct 2017 17:09:30 +0100 Subject: [PATCH 1/4] pass search query to filter fn in _updateList Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/MemberList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index 0713a4ae8a..781126c543 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -146,8 +146,8 @@ module.exports = React.createClass({ const newState = { members: this.roomMembers(), }; - newState.filteredJoinedMembers = this._filterMembers(newState.members, 'join'); - newState.filteredInvitedMembers = this._filterMembers(newState.members, 'invite'); + newState.filteredJoinedMembers = this._filterMembers(newState.members, 'join', this.state.searchQuery); + newState.filteredInvitedMembers = this._filterMembers(newState.members, 'invite', this.state.searchQuery); this.setState(newState); }, 500), From 6ad8532bedc5ef881a39770e4ff320f3384b85e0 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 14 Oct 2017 17:09:58 +0100 Subject: [PATCH 2/4] lowerCase query so that searching for `Erik` will actually find `Erik`.. Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/MemberList.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index 781126c543..4789dda192 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -302,6 +302,7 @@ module.exports = React.createClass({ const m = this.memberDict[userId]; if (query) { + query = query.toLowerCase(); const matchesName = m.name.toLowerCase().indexOf(query) !== -1; const matchesId = m.userId.toLowerCase().indexOf(query) !== -1; @@ -399,7 +400,7 @@ module.exports = React.createClass({
); @@ -412,9 +413,9 @@ module.exports = React.createClass({ getChildren={this._getChildrenJoined} getChildCount={this._getChildCountJoined} /> - { invitedSection } + {invitedSection} ); - }, + } }); From e79f9ef0115fcee0d078e8eb88c51d574587ed68 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 14 Oct 2017 17:10:51 +0100 Subject: [PATCH 3/4] === > == Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/MemberList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index 4789dda192..f4d81d19f0 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -187,7 +187,7 @@ module.exports = React.createClass({ const user_id = all_user_ids[i]; const m = all_members[user_id]; - if (m.membership == 'join' || m.membership == 'invite') { + if (m.membership === 'join' || m.membership === 'invite') { if ((ConferenceHandler && !ConferenceHandler.isConferenceUser(user_id)) || !ConferenceHandler) { to_display.push(user_id); ++count; @@ -311,7 +311,7 @@ module.exports = React.createClass({ } } - return m.membership == membership; + return m.membership === membership; }); }, From b0b7472901f8840599d86c21cb3fcb99887cc643 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 14 Oct 2017 17:14:17 +0100 Subject: [PATCH 4/4] undo bad merge Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/MemberList.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index f4d81d19f0..04b6089559 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -400,7 +400,7 @@ module.exports = React.createClass({ ); @@ -413,9 +413,9 @@ module.exports = React.createClass({ getChildren={this._getChildrenJoined} getChildCount={this._getChildCountJoined} /> - {invitedSection} + { invitedSection } ); - } + }, });