Allow Modal to be used with async-loaded components
Add Modal.createDialogAsync, which can be used to display asynchronously-loaded React components. Also make EncryptedEventDialog use it as a handy demonstration.
This commit is contained in:
@@ -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,
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user