diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index bfd8ae8e86..48431a956b 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -513,8 +513,6 @@ module.exports = React.createClass({ var ChatInviteDialog = sdk.getComponent("dialogs.ChatInviteDialog"); Modal.createDialog(ChatInviteDialog, { title: "Start a one to one chat", - description: "Who would you like to communicate with?", - placeholder: "User ID, Name or email", }); }, diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index 07dc3e7809..2445dfb8f3 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -29,6 +29,7 @@ module.exports = React.createClass({ React.PropTypes.string, ]), value: React.PropTypes.string, + placeholder: React.PropTypes.string, button: React.PropTypes.string, focus: React.PropTypes.bool, onFinished: React.PropTypes.func.isRequired @@ -36,9 +37,10 @@ module.exports = React.createClass({ getDefaultProps: function() { return { - title: "", + title: "Start a chat", + description: "Who would you like to communicate with?", value: "", - description: "", + placeholder: "User ID, Name or email", button: "Start Chat", focus: true }; @@ -56,18 +58,21 @@ module.exports = React.createClass({ }, _startChat: function(addr) { + // Start the chat createRoom().then(function(roomId) { return Invite.inviteToRoom(roomId, addr); }) .catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { - title: "Failure to invite " + addr, + title: "Failure to invite user", description: err.toString() }); return null; }) .done(); + + // Close - this will happen before the above, as that is async this.props.onFinished(true, addr); },