Merge pull request #1081 from matrix-org/luke/fix-chat-invite-dialog-clobbered-request
Only process user_directory response if it's for the current querypull/21833/head
						commit
						29371120ff
					
				| 
						 | 
				
			
			@ -241,6 +241,11 @@ module.exports = React.createClass({
 | 
			
		|||
        MatrixClientPeg.get().searchUserDirectory({
 | 
			
		||||
            term: query,
 | 
			
		||||
        }).then((resp) => {
 | 
			
		||||
            // The query might have changed since we sent the request, so ignore
 | 
			
		||||
            // responses for anything other than the latest query.
 | 
			
		||||
            if (this.state.query !== query) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            this._processResults(resp.results, query);
 | 
			
		||||
        }).catch((err) => {
 | 
			
		||||
            console.error('Error whilst searching user directory: ', err);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue