Commit 9823fae9 authored by Denys Mishunov's avatar Denys Mishunov

Dispatch editor-ready only on success

parent 9f4ef4b5
......@@ -51,7 +51,7 @@ export default class Editor {
const extensionsArray = typeof extensions === 'string' ? extensions.split(',') : extensions;
extensionsArray.forEach(ext => {
const prefix = ext.indexOf('/') === -1 ? 'editor/' : '';
const prefix = ext.includes('/') ? '' : 'editor/';
const trimmedExt = ext.replace(/^\//, '').trim();
Editor.pushToImportsArray(promises, `~/${prefix}${trimmedExt}`);
});
......@@ -111,11 +111,11 @@ export default class Editor {
});
}
})
.then(() => {
el.dispatchEvent(new Event('editor-ready'));
})
.catch(e => {
throw e;
})
.finally(() => {
el.dispatchEvent(new Event('editor-ready'));
});
this.instances.push(instance);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment