diff options
author | 2019-02-01 10:35:18 +0100 | |
---|---|---|
committer | 2019-02-01 10:35:18 +0100 | |
commit | da92cd426cbf350313945e3459f96638a79bd44e (patch) | |
tree | 931d18bbf62854366ccf7021d6206de7e0c42636 /src/webview/recipe.js | |
parent | Update stale.yml (diff) | |
parent | b23 (diff) | |
download | ferdium-app-da92cd426cbf350313945e3459f96638a79bd44e.tar.gz ferdium-app-da92cd426cbf350313945e3459f96638a79bd44e.tar.zst ferdium-app-da92cd426cbf350313945e3459f96638a79bd44e.zip |
Merge branch 'develop'v5.0.0-beta.23
Diffstat (limited to 'src/webview/recipe.js')
-rw-r--r-- | src/webview/recipe.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/webview/recipe.js b/src/webview/recipe.js index 944883899..9aa89ce01 100644 --- a/src/webview/recipe.js +++ b/src/webview/recipe.js | |||
@@ -42,9 +42,9 @@ class RecipeController { | |||
42 | 42 | ||
43 | async initialize() { | 43 | async initialize() { |
44 | Object.keys(this.ipcEvents).forEach((channel) => { | 44 | Object.keys(this.ipcEvents).forEach((channel) => { |
45 | ipcRenderer.on(channel, (event, data) => { | 45 | ipcRenderer.on(channel, (...args) => { |
46 | debug('Received IPC event for channel', channel, 'with', data); | 46 | debug('Received IPC event for channel', channel, 'with', ...args); |
47 | this[this.ipcEvents[channel]](event, data); | 47 | this[this.ipcEvents[channel]](...args); |
48 | }); | 48 | }); |
49 | }); | 49 | }); |
50 | 50 | ||
@@ -62,17 +62,18 @@ class RecipeController { | |||
62 | autorun(() => this.update()); | 62 | autorun(() => this.update()); |
63 | } | 63 | } |
64 | 64 | ||
65 | loadRecipeModule(event, data) { | 65 | loadRecipeModule(event, config, recipe) { |
66 | debug('loadRecipeModule'); | 66 | debug('loadRecipeModule'); |
67 | const modulePath = path.join(data.recipe.path, 'webview.js'); | 67 | const modulePath = path.join(recipe.path, 'webview.js'); |
68 | debug('module path', modulePath); | ||
68 | // Delete module from cache | 69 | // Delete module from cache |
69 | delete require.cache[require.resolve(modulePath)]; | 70 | delete require.cache[require.resolve(modulePath)]; |
70 | try { | 71 | try { |
71 | // eslint-disable-next-line | 72 | // eslint-disable-next-line |
72 | require(modulePath)(new RecipeWebview(), data); | 73 | require(modulePath)(new RecipeWebview(), {...config, recipe,}); |
73 | debug('Initialize Recipe', data); | 74 | debug('Initialize Recipe', config, recipe); |
74 | 75 | ||
75 | this.settings.service = data; | 76 | this.settings.service = config; |
76 | } catch (err) { | 77 | } catch (err) { |
77 | console.error('Recipe initialization failed', err); | 78 | console.error('Recipe initialization failed', err); |
78 | } | 79 | } |