mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 22:14:58 +08:00
fix dialog prompt an embarassing bug where if 3pid invites triggered a dialog they'd get wedged
This commit is contained in:
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) {
|
||||||
|
// 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);
|
this.onInvite(addresses);
|
||||||
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user