mirror of https://github.com/vector-im/riot-web
fix dialog prompt an embarassing bug where if 3pid invites triggered a dialog they'd get wedged
parent
532e93d7cb
commit
1b3c8481f6
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue