Merge pull request #618 from matrix-org/rav/async_dialog

Allow Modal to be used with async-loaded components
This commit is contained in:
Richard van der Hoff 2017-01-19 16:08:30 +00:00 committed by GitHub
commit ba2460aef4
4 changed files with 74 additions and 6 deletions

View file

@ -366,10 +366,11 @@ module.exports = WithMatrixClient(React.createClass({
},
onCryptoClicked: function(e) {
var EncryptedEventDialog = sdk.getComponent("dialogs.EncryptedEventDialog");
var event = this.props.mxEvent;
Modal.createDialog(EncryptedEventDialog, {
Modal.createDialogAsync((cb) => {
require(['../../../async-components/views/dialogs/EncryptedEventDialog'], cb)
}, {
event: event,
});
},