Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 33f5d81

Browse files
Luke Barnarddbkr
authored andcommitted
Only process user_directory response if it's for the current query
1 parent 3562031 commit 33f5d81

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/views/dialogs/ChatInviteDialog.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ module.exports = React.createClass({
241241
MatrixClientPeg.get().searchUserDirectory({
242242
term: query,
243243
}).then((resp) => {
244+
// The query might have changed since we sent the request, so ignore
245+
// responses for anything other than the latest query.
246+
if (this.state.query !== query) {
247+
return;
248+
}
244249
this._processResults(resp.results, query);
245250
}).catch((err) => {
246251
console.error('Error whilst searching user directory: ', err);

0 commit comments

Comments
 (0)