diff options
Diffstat (limited to 'web/react/components/more_direct_channels.jsx')
-rw-r--r-- | web/react/components/more_direct_channels.jsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/web/react/components/more_direct_channels.jsx b/web/react/components/more_direct_channels.jsx index ba0bff599..e0aeb3051 100644 --- a/web/react/components/more_direct_channels.jsx +++ b/web/react/components/more_direct_channels.jsx @@ -209,12 +209,14 @@ export default class MoreDirectChannels extends React.Component { } let users = this.state.users; - if (this.state.filter !== '') { + if (this.state.filter) { + const filter = this.state.filter.toLowerCase(); + users = users.filter((user) => { - return user.username.indexOf(this.state.filter) !== -1 || - user.first_name.indexOf(this.state.filter) !== -1 || - user.last_name.indexOf(this.state.filter) !== -1 || - user.nickname.indexOf(this.state.filter) !== -1; + return user.username.toLowerCase().indexOf(filter) !== -1 || + user.first_name.toLowerCase().indexOf(filter) !== -1 || + user.last_name.toLowerCase().indexOf(filter) !== -1 || + user.nickname.toLowerCase().indexOf(filter) !== -1; }); } |