From dc08d9dfdfb75d154f1a7464dc50e822a369e5e0 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 23 Jan 2017 12:18:41 +0000 Subject: [PATCH] Fix device verification from e2e info Don't attempt to reuse the same AsyncWrapper for different dialogs - which ends up pushing the props for the new dialog into the old dialog. Fixes https://github.com/vector-im/riot-web/issues/3020 --- src/Modal.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Modal.js b/src/Modal.js index 862e4befc5..f0ab97a91e 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -67,6 +67,8 @@ const AsyncWrapper = React.createClass({ }, }); +let _counter = 0; + module.exports = { DialogContainerId: "mx_Dialog_Container", @@ -113,12 +115,16 @@ module.exports = { ReactDOM.unmountComponentAtNode(self.getOrCreateContainer()); }; + // don't attempt to reuse the same AsyncWrapper for different dialogs, + // otherwise we'll get confused. + const modalCount = _counter++; + // FIXME: If a dialog uses getDefaultProps it clobbers the onFinished // property set here so you can't close the dialog from a button click! var dialog = (
- +