Discard outdated results in modal searches (#5082)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
4257114a37
Коммит
6b2c4a346b
@@ -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() {
|
||||
|
||||
Ссылка в новой задаче
Block a user