From 1b3c8481f6ceaaf51328c6f383f9ce98e45bdd21 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 2 Jun 2016 21:07:47 +0100 Subject: [PATCH] fix dialog prompt an embarassing bug where if 3pid invites triggered a dialog they'd get wedged --- src/components/views/rooms/MemberList.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index 21c0827fcc..328f9774c7 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -170,12 +170,16 @@ module.exports = React.createClass({ var TextInputDialog = sdk.getComponent("dialogs.TextInputDialog"); Modal.createDialog(TextInputDialog, { 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, button: "Invite", onFinished: (should_invite, addresses)=>{ 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); } } });