Discard outdated results in modal searches (#5082)

Этот коммит содержится в:
Joram Wilander
2017-01-16 18:32:51 -05:00
коммит произвёл Corey Hulen
родитель 4257114a37
Коммит 6b2c4a346b
6 изменённых файлов: 43 добавлений и 8 удалений

Просмотреть файл

@@ -158,13 +158,17 @@ export default class UserList extends React.Component {
clearTimeout(this.searchTimeoutId);
this.searchTimeoutId = setTimeout(
const searchTimeoutId = setTimeout(
() => {
searchUsers(
term,
this.props.params.team,
options,
(users) => {
if (searchTimeoutId !== this.searchTimeoutId) {
return;
}
this.setState({loading: true, search: true, users});
loadTeamMembersForProfilesList(users, this.props.params.team, this.loadComplete);
}
@@ -172,6 +176,8 @@ export default class UserList extends React.Component {
},
Constants.SEARCH_TIMEOUT_MILLISECONDS
);
this.searchTimeoutId = searchTimeoutId;
}
render() {