diff options
Diffstat (limited to 'src/stores/ServicesStore.js')
-rw-r--r-- | src/stores/ServicesStore.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index a618da547..f79197c38 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -1,5 +1,8 @@ | |||
1 | import { | 1 | import { |
2 | action, reaction, computed, observable, | 2 | action, |
3 | reaction, | ||
4 | computed, | ||
5 | observable, | ||
3 | } from 'mobx'; | 6 | } from 'mobx'; |
4 | import { debounce, remove } from 'lodash'; | 7 | import { debounce, remove } from 'lodash'; |
5 | 8 | ||
@@ -324,7 +327,11 @@ export default class ServicesStore extends Store { | |||
324 | service.webview = webview; | 327 | service.webview = webview; |
325 | 328 | ||
326 | if (!service.isAttached) { | 329 | if (!service.isAttached) { |
327 | 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 | }); | ||
328 | service.initializeWebViewListener(); | 335 | service.initializeWebViewListener(); |
329 | } | 336 | } |
330 | 337 | ||
@@ -659,14 +666,15 @@ export default class ServicesStore extends Store { | |||
659 | const service = this.one(serviceId); | 666 | const service = this.one(serviceId); |
660 | 667 | ||
661 | if (service.webview) { | 668 | if (service.webview) { |
662 | service.webview.send('initialize-recipe', service); | 669 | debug('Initialize recipe', service.recipe.id, service.name); |
670 | service.webview.send('initialize-recipe', service.shareWithWebview, service.recipe); | ||
663 | } | 671 | } |
664 | } | 672 | } |
665 | 673 | ||
666 | _initRecipePolling(serviceId) { | 674 | _initRecipePolling(serviceId) { |
667 | const service = this.one(serviceId); | 675 | const service = this.one(serviceId); |
668 | 676 | ||
669 | const delay = 1000; | 677 | const delay = 2000; |
670 | 678 | ||
671 | if (service) { | 679 | if (service) { |
672 | if (service.timer !== null) { | 680 | if (service.timer !== null) { |