Skip to content

Commit

Permalink
Load correct editor file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiiks committed Feb 28, 2019
1 parent b22923d commit b8d16c6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/src/modules/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,13 @@ export default class Editor extends Module {
* Opens an editor.
* @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) => {
if (this.editor) {
if (this.editor.isFocused()) return;
Expand All @@ -236,7 +242,7 @@ export default class Editor extends Module {
});

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);
});
})
Expand Down

0 comments on commit b8d16c6

Please sign in to comment.