fix dialog prompt an embarassing bug where if 3pid invites triggered a dialog they'd get wedged

pull/21833/head
Matthew Hodgson 2016-06-02 21:07:47 +01:00
parent 532e93d7cb
commit 1b3c8481f6
1 changed files with 6 additions and 2 deletions

View File

@ -170,12 +170,16 @@ module.exports = React.createClass({
var TextInputDialog = sdk.getComponent("dialogs.TextInputDialog"); var TextInputDialog = sdk.getComponent("dialogs.TextInputDialog");
Modal.createDialog(TextInputDialog, { Modal.createDialog(TextInputDialog, {
title: "Invite members by email", title: "Invite members by email",
description: "Please enter the email addresses to be invited (comma separated)", description: "Please enter one or more email addresses",
value: inputText, value: inputText,
button: "Invite", button: "Invite",
onFinished: (should_invite, addresses)=>{ onFinished: (should_invite, addresses)=>{
if (should_invite) { if (should_invite) {
this.onInvite(addresses); // defer the actual invite to the next event loop to give this
// Modal a chance to unmount in case onInvite() triggers a new one
setTimeout(()=>{
this.onInvite(addresses);
}, 0);
} }
} }
}); });