diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-12-15 11:40:46 -0500 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-12-15 13:40:46 -0300 |
commit | 7f48a7fc9d2238134414668e0b520115706b8b2d (patch) | |
tree | c7b485e0305a46e10ea997ea3450c2c040efcb95 /webapp/components/admin_console | |
parent | c35b95709e293680f882f27ab6e616bf8f92a7cc (diff) | |
download | chat-7f48a7fc9d2238134414668e0b520115706b8b2d.tar.gz chat-7f48a7fc9d2238134414668e0b520115706b8b2d.tar.bz2 chat-7f48a7fc9d2238134414668e0b520115706b8b2d.zip |
PLT-4815 Refactor 'More Channels' modal into the new modal pattern (#4742)
* Refactor 'More Channels' modal into the new modal pattern
* Fix unit test
* Readded CSS changes
Diffstat (limited to 'webapp/components/admin_console')
-rw-r--r-- | webapp/components/admin_console/team_users.jsx | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/webapp/components/admin_console/team_users.jsx b/webapp/components/admin_console/team_users.jsx index 49550d8af..1cbb0e85f 100644 --- a/webapp/components/admin_console/team_users.jsx +++ b/webapp/components/admin_console/team_users.jsx @@ -43,6 +43,8 @@ export default class UserList extends React.Component { this.search = this.search.bind(this); this.loadComplete = this.loadComplete.bind(this); + this.searchTimeoutId = 0; + const stats = TeamStore.getStats(this.props.params.team); this.state = { @@ -148,14 +150,21 @@ export default class UserList extends React.Component { const options = {}; options[UserSearchOptions.ALLOW_INACTIVE] = true; - searchUsers( - term, - this.props.params.team, - options, - (users) => { - this.setState({loading: true, search: true, users}); - loadTeamMembersForProfilesList(users, this.props.params.team, this.loadComplete); - } + clearTimeout(this.searchTimeoutId); + + this.searchTimeoutId = setTimeout( + () => { + searchUsers( + term, + this.props.params.team, + options, + (users) => { + this.setState({loading: true, search: true, users}); + loadTeamMembersForProfilesList(users, this.props.params.team, this.loadComplete); + } + ); + }, + Constants.SEARCH_TIMEOUT_MILLISECONDS ); } |