Merge pull request #1480 from matrix-org/t3chguy/fix_memberlist

T3chguy/fix memberlist
This commit is contained in:
Matthew Hodgson 2017-10-14 22:09:55 +01:00 committed by GitHub
commit 0284a582a1

View file

@ -146,8 +146,8 @@ module.exports = React.createClass({
const newState = { const newState = {
members: this.roomMembers(), members: this.roomMembers(),
}; };
newState.filteredJoinedMembers = this._filterMembers(newState.members, 'join'); newState.filteredJoinedMembers = this._filterMembers(newState.members, 'join', this.state.searchQuery);
newState.filteredInvitedMembers = this._filterMembers(newState.members, 'invite'); newState.filteredInvitedMembers = this._filterMembers(newState.members, 'invite', this.state.searchQuery);
this.setState(newState); this.setState(newState);
}, 500), }, 500),
@ -187,7 +187,7 @@ module.exports = React.createClass({
const user_id = all_user_ids[i]; const user_id = all_user_ids[i];
const m = all_members[user_id]; 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) { if ((ConferenceHandler && !ConferenceHandler.isConferenceUser(user_id)) || !ConferenceHandler) {
to_display.push(user_id); to_display.push(user_id);
++count; ++count;
@ -302,6 +302,7 @@ module.exports = React.createClass({
const m = this.memberDict[userId]; const m = this.memberDict[userId];
if (query) { if (query) {
query = query.toLowerCase();
const matchesName = m.name.toLowerCase().indexOf(query) !== -1; const matchesName = m.name.toLowerCase().indexOf(query) !== -1;
const matchesId = m.userId.toLowerCase().indexOf(query) !== -1; const matchesId = m.userId.toLowerCase().indexOf(query) !== -1;
@ -310,7 +311,7 @@ module.exports = React.createClass({
} }
} }
return m.membership == membership; return m.membership === membership;
}); });
}, },