Set state in _lookupThreepid
This commit is contained in:
parent
e1e87807b5
commit
bf66f77acb
1 changed files with 11 additions and 15 deletions
|
@ -195,13 +195,7 @@ module.exports = React.createClass({
|
|||
isKnown: false,
|
||||
};
|
||||
if (addrType == 'email') {
|
||||
this._lookupThreepid(addrType, query).then((res) => {
|
||||
if (res !== null) {
|
||||
this.setState({
|
||||
queryList: [res]
|
||||
});
|
||||
}
|
||||
}).done();
|
||||
this._lookupThreepid(addrType, query).done();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -467,14 +461,16 @@ module.exports = React.createClass({
|
|||
if (this.state.queryList[0] && this.state.queryList[0].address !== address) {
|
||||
return null;
|
||||
}
|
||||
// return an InviteAddressType
|
||||
return {
|
||||
addressType: medium,
|
||||
address: address,
|
||||
displayName: res.displayname,
|
||||
avatarMxc: res.avatar_url,
|
||||
isKnown: true,
|
||||
}
|
||||
this.setState({
|
||||
queryList: [{
|
||||
// an InviteAddressType
|
||||
addressType: medium,
|
||||
address: address,
|
||||
displayName: res.displayname,
|
||||
avatarMxc: res.avatar_url,
|
||||
isKnown: true,
|
||||
}]
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue