From c3566e0b49305e13e93043ad434bd7d1c5a9cee6 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Wed, 14 Sep 2016 15:17:29 +0100 Subject: [PATCH] _isDmChat needs to check the passed in addrs rather than the state.inviteList as they may now differ --- src/components/views/dialogs/ChatInviteDialog.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index d03341502c..f797131814 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -221,7 +221,7 @@ module.exports = React.createClass({ return null; }) .done(); - } else if (this._isDmChat()) { + } else if (this._isDmChat(addrs)) { // Start the DM chat createRoom({dmUserId: addrs[0]}) .catch(function(err) { @@ -299,8 +299,8 @@ module.exports = React.createClass({ return false; }, - _isDmChat: function() { - if (this.state.inviteList.length === 1 && Invite.getAddressType(this.state.inviteList[0]) === "mx" && !this.props.roomId) { + _isDmChat: function(addrs) { + if (addrs.length === 1 && Invite.getAddressType(addrs[0]) === "mx" && !this.props.roomId) { return true; } else { return false;