Update async dialog interface to use promises
Hopefully makes the syntax a bit nicer. Also uses ES6 async import rather than require.ensure which is now deprecated. Also also displays an error if the component fails to load rather than falling over in a heap, which is nice.
This commit is contained in:
parent
93cd3b4206
commit
985966f8be
8 changed files with 66 additions and 47 deletions
|
@ -416,11 +416,10 @@ module.exports = withMatrixClient(React.createClass({
|
|||
onCryptoClicked: function(e) {
|
||||
const event = this.props.mxEvent;
|
||||
|
||||
Modal.createTrackedDialogAsync('Encrypted Event Dialog', '', (cb) => {
|
||||
require(['../../../async-components/views/dialogs/EncryptedEventDialog'], cb);
|
||||
}, {
|
||||
event: event,
|
||||
});
|
||||
Modal.createTrackedDialogAsync('Encrypted Event Dialog', '',
|
||||
import('../../../async-components/views/dialogs/EncryptedEventDialog'),
|
||||
{event},
|
||||
);
|
||||
},
|
||||
|
||||
onRequestKeysClick: function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue