Matthew Hodgson 2016-03-17 18:49:34 +00:00
parent 396d23b267
commit be5173a8db

View file

@ -217,11 +217,8 @@ module.exports = React.createClass({
console.log( console.log(
"Invite %s to %s - isEmail=%s", inputText, this.props.roomId, isEmailAddress "Invite %s to %s - isEmail=%s", inputText, this.props.roomId, isEmailAddress
); );
promise.done(function(res) { promise.then(function(res) {
console.log("Invited %s", inputText); console.log("Invited %s", inputText);
self.setState({
inviting: false
});
}, function(err) { }, function(err) {
if (err !== null) { if (err !== null) {
console.error("Failed to invite: %s", JSON.stringify(err)); console.error("Failed to invite: %s", JSON.stringify(err));
@ -230,9 +227,17 @@ module.exports = React.createClass({
description: err.message description: err.message
}); });
} }
}).finally(function() {
self.setState({ self.setState({
inviting: false inviting: false
}); });
// XXX: hacky focus on the invite box
setTimeout(function() {
var inviteBox = document.getElementById("mx_SearchableEntityList_query");
if (inviteBox) {
inviteBox.focus();
}
}, 0);
}); });
}, },