Adding better deafults and ErrorDialog message

This commit is contained in:
wmwragg 2016-09-05 14:29:21 +01:00
parent 3d66dff0aa
commit d9c6448a0f
2 changed files with 8 additions and 5 deletions

View file

@ -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",
});
},

View file

@ -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);
},