Load correct editor file
This commit is contained in:
parent
b22923d12f
commit
b8d16c6e4d
|
@ -209,7 +209,13 @@ export default class Editor extends Module {
|
||||||
* Opens an editor.
|
* Opens an editor.
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
openEditor(options) {
|
async openEditor(options) {
|
||||||
|
if (!this.editorPkg) {
|
||||||
|
this.editorPkg = await FileUtils.readJsonFromFile(path.join(this.editorPath, 'package.json'));
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(this.editorPkg);
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (this.editor) {
|
if (this.editor) {
|
||||||
if (this.editor.isFocused()) return;
|
if (this.editor.isFocused()) return;
|
||||||
|
@ -236,7 +242,7 @@ export default class Editor extends Module {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.editor.webContents.on('did-finish-load', () => {
|
this.editor.webContents.on('did-finish-load', () => {
|
||||||
this.editorUtils.injectScript(path.join(this.editorPath, 'editor.js'));
|
this.editorUtils.injectScript(path.join(this.editorPath, this.editorPkg.main));
|
||||||
resolve(true);
|
resolve(true);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue