mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 14:05:04 +08:00
_isDmChat needs to check the passed in addrs rather than the state.inviteList as they may now differ
This commit is contained in:
parent
a7a81c8a32
commit
c3566e0b49
@ -221,7 +221,7 @@ module.exports = React.createClass({
|
|||||||
return null;
|
return null;
|
||||||
})
|
})
|
||||||
.done();
|
.done();
|
||||||
} else if (this._isDmChat()) {
|
} else if (this._isDmChat(addrs)) {
|
||||||
// Start the DM chat
|
// Start the DM chat
|
||||||
createRoom({dmUserId: addrs[0]})
|
createRoom({dmUserId: addrs[0]})
|
||||||
.catch(function(err) {
|
.catch(function(err) {
|
||||||
@ -299,8 +299,8 @@ module.exports = React.createClass({
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
_isDmChat: function() {
|
_isDmChat: function(addrs) {
|
||||||
if (this.state.inviteList.length === 1 && Invite.getAddressType(this.state.inviteList[0]) === "mx" && !this.props.roomId) {
|
if (addrs.length === 1 && Invite.getAddressType(addrs[0]) === "mx" && !this.props.roomId) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user