diff options
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/ServicesStore.js | 17 |
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 @@ | |||
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 | ||
@@ -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) { |