mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Updated with the new createRoom DM stuff
This commit is contained in:
parent
524eeaa315
commit
538b68a6b2
1 changed files with 3 additions and 15 deletions
|
@ -200,7 +200,8 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
_startChat: function(addr) {
|
_startChat: function(addr) {
|
||||||
if (this.props.roomId) {
|
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");
|
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
Modal.createDialog(ErrorDialog, {
|
Modal.createDialog(ErrorDialog, {
|
||||||
title: "Failure to invite user",
|
title: "Failure to invite user",
|
||||||
|
@ -211,9 +212,7 @@ module.exports = React.createClass({
|
||||||
.done();
|
.done();
|
||||||
} else {
|
} else {
|
||||||
// Start the chat
|
// Start the chat
|
||||||
createRoom().then(function(roomId) {
|
createRoom({dmUserId: addr})
|
||||||
return Invite.inviteToRoom(roomId, addr);
|
|
||||||
})
|
|
||||||
.catch(function(err) {
|
.catch(function(err) {
|
||||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
Modal.createDialog(ErrorDialog, {
|
Modal.createDialog(ErrorDialog, {
|
||||||
|
@ -224,17 +223,6 @@ module.exports = React.createClass({
|
||||||
})
|
})
|
||||||
.done();
|
.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
|
// Close - this will happen before the above, as that is async
|
||||||
this.props.onFinished(true, addr);
|
this.props.onFinished(true, addr);
|
||||||
|
|
Loading…
Reference in a new issue