Remove race between clearing lists and search requests (#5686)

This commit is contained in:
Joram Wilander
2017-03-09 04:15:38 -05:00
committed by George Goldberg
parent bfc8dafe5e
commit cbead2d973
5 changed files with 15 additions and 10 deletions

View File

@@ -148,16 +148,17 @@ export default class UserList extends React.Component {
}
search(term) {
clearTimeout(this.searchTimeoutId);
if (term === '') {
this.setState({search: false, users: UserStore.getProfileListInTeam(this.props.params.team)});
this.searchTimeoutId = '';
return;
}
const options = {};
options[UserSearchOptions.ALLOW_INACTIVE] = true;
clearTimeout(this.searchTimeoutId);
const searchTimeoutId = setTimeout(
() => {
searchUsers(