From 538b68a6b272ac72ffcb7b46099c185d8c685577 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Tue, 13 Sep 2016 12:47:31 +0100 Subject: [PATCH] Updated with the new createRoom DM stuff --- .../views/dialogs/ChatInviteDialog.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index e4ed432acd..38f45a9370 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -200,7 +200,8 @@ module.exports = React.createClass({ _startChat: function(addr) { if (this.props.roomId) { - Invite.inviteToRoom(this.props.roomId, addr).catch(function(err) { + Invite.inviteToRoom(this.props.roomId, addr) + .catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failure to invite user", @@ -211,9 +212,7 @@ module.exports = React.createClass({ .done(); } else { // Start the chat - createRoom().then(function(roomId) { - return Invite.inviteToRoom(roomId, addr); - }) + createRoom({dmUserId: addr}) .catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { @@ -224,17 +223,6 @@ module.exports = React.createClass({ }) .done(); } -// // Start the chat -// createRoom({dmUserId: addr}) -// .catch(function(err) { -// var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); -// Modal.createDialog(ErrorDialog, { -// 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);