Fix filtering user list by ID

Fixes https://github.com/vector-im/vector-web/issues/1739
pull/21833/head
David Baker 2016-07-13 11:56:01 +01:00
parent da8f7df262
commit 6b03f72474
1 changed files with 9 additions and 2 deletions

View File

@ -442,9 +442,16 @@ module.exports = React.createClass({
var memberList = self.state.members.filter(function(userId) {
var m = self.memberDict[userId];
if (query && m.name.toLowerCase().indexOf(query) === -1) {
return false;
if (query) {
const matchesName = m.name.toLowerCase().indexOf(query) !== -1;
const matchesId = m.userId.toLowerCase().indexOf(query) !== -1;
if (!matchesName && !matchesId) {
return false;
}
}
return m.membership == membership;
}).map(function(userId) {
var m = self.memberDict[userId];