aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/ServicesStore.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-12-22 15:03:46 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2018-12-22 15:03:46 +0100
commit5ad6eea6ea24bf6b4cdb8b314150c6fa5f9da896 (patch)
tree11907a50c6ed914c13b9264fa233ec9c03f32579 /src/stores/ServicesStore.js
parentbump version to b22 (diff)
downloadferdium-app-5ad6eea6ea24bf6b4cdb8b314150c6fa5f9da896.tar.gz
ferdium-app-5ad6eea6ea24bf6b4cdb8b314150c6fa5f9da896.tar.zst
ferdium-app-5ad6eea6ea24bf6b4cdb8b314150c6fa5f9da896.zip
Make electron 4 compatible
Diffstat (limited to 'src/stores/ServicesStore.js')
-rw-r--r--src/stores/ServicesStore.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index 5b70ca271..b0a926d6a 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -1,5 +1,8 @@
1import { 1import {
2 action, reaction, computed, observable, 2 action,
3 reaction,
4 computed,
5 observable,
3} from 'mobx'; 6} from 'mobx';
4import { debounce, remove } from 'lodash'; 7import { debounce, remove } from 'lodash';
5 8
@@ -318,12 +321,17 @@ export default class ServicesStore extends Store {
318 } 321 }
319 322
320 @action _setWebviewReference({ serviceId, webview }) { 323 @action _setWebviewReference({ serviceId, webview }) {
324 debug('Set webview reference', serviceId, webview)
321 const service = this.one(serviceId); 325 const service = this.one(serviceId);
322 326
323 service.webview = webview; 327 service.webview = webview;
324 328
325 if (!service.isAttached) { 329 if (!service.isAttached) {
326 service.initializeWebViewEvents(this); 330 debug('Webview is not attached, initializing');
331 service.initializeWebViewEvents({
332 handleIPCMessage: this.actions.service.handleIPCMessage,
333 openWindow: this.actions.service.openWindow,
334 });
327 service.initializeWebViewListener(); 335 service.initializeWebViewListener();
328 } 336 }
329 337
@@ -644,14 +652,15 @@ export default class ServicesStore extends Store {
644 const service = this.one(serviceId); 652 const service = this.one(serviceId);
645 653
646 if (service.webview) { 654 if (service.webview) {
647 service.webview.send('initialize-recipe', service); 655 debug('Initialize recipe', service.recipe.id, service.name);
656 service.webview.send('initialize-recipe', service.shareWithWebview, service.recipe);
648 } 657 }
649 } 658 }
650 659
651 _initRecipePolling(serviceId) { 660 _initRecipePolling(serviceId) {
652 const service = this.one(serviceId); 661 const service = this.one(serviceId);
653 662
654 const delay = 1000; 663 const delay = 2000;
655 664
656 if (service) { 665 if (service) {
657 if (service.timer !== null) { 666 if (service.timer !== null) {