diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-01-05 21:12:42 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-01-05 21:12:42 +0100 |
commit | 904eb333103e0d3b9f6c23ca49d76d403f43ded3 (patch) | |
tree | 8f3367d306fb4d9d9f82e6bc5dd502853e63cbca /src/stores | |
parent | Add lerna instructions (diff) | |
download | ferdium-app-904eb333103e0d3b9f6c23ca49d76d403f43ded3.tar.gz ferdium-app-904eb333103e0d3b9f6c23ca49d76d403f43ded3.tar.zst ferdium-app-904eb333103e0d3b9f6c23ca49d76d403f43ded3.zip |
Merge
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/ServicesStore.js | 16 | ||||
-rw-r--r-- | src/stores/UIStore.js | 7 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 5b70ca271..84f84891a 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 | ||
@@ -323,7 +326,11 @@ export default class ServicesStore extends Store { | |||
323 | service.webview = webview; | 326 | service.webview = webview; |
324 | 327 | ||
325 | if (!service.isAttached) { | 328 | if (!service.isAttached) { |
326 | service.initializeWebViewEvents(this); | 329 | debug('Webview is not attached, initializing'); |
330 | service.initializeWebViewEvents({ | ||
331 | handleIPCMessage: this.actions.service.handleIPCMessage, | ||
332 | openWindow: this.actions.service.openWindow, | ||
333 | }); | ||
327 | service.initializeWebViewListener(); | 334 | service.initializeWebViewListener(); |
328 | } | 335 | } |
329 | 336 | ||
@@ -644,14 +651,15 @@ export default class ServicesStore extends Store { | |||
644 | const service = this.one(serviceId); | 651 | const service = this.one(serviceId); |
645 | 652 | ||
646 | if (service.webview) { | 653 | if (service.webview) { |
647 | service.webview.send('initialize-recipe', service); | 654 | debug('Initialize recipe', service.recipe.id, service.name); |
655 | service.webview.send('initialize-recipe', service.shareWithWebview, service.recipe); | ||
648 | } | 656 | } |
649 | } | 657 | } |
650 | 658 | ||
651 | _initRecipePolling(serviceId) { | 659 | _initRecipePolling(serviceId) { |
652 | const service = this.one(serviceId); | 660 | const service = this.one(serviceId); |
653 | 661 | ||
654 | const delay = 1000; | 662 | const delay = 2000; |
655 | 663 | ||
656 | if (service) { | 664 | if (service) { |
657 | if (service.timer !== null) { | 665 | if (service.timer !== null) { |
diff --git a/src/stores/UIStore.js b/src/stores/UIStore.js index d37ebe4c7..188c2fc44 100644 --- a/src/stores/UIStore.js +++ b/src/stores/UIStore.js | |||
@@ -1,8 +1,7 @@ | |||
1 | import { action, observable, computed } from 'mobx'; | 1 | import { action, observable, computed } from 'mobx'; |
2 | import theme from '@meetfranz/theme'; | ||
2 | 3 | ||
3 | import Store from './lib/Store'; | 4 | import Store from './lib/Store'; |
4 | import * as themeDefault from '../theme/default'; | ||
5 | import * as themeDark from '../theme/dark'; | ||
6 | 5 | ||
7 | export default class UIStore extends Store { | 6 | export default class UIStore extends Store { |
8 | @observable showServicesUpdatedInfoBar = false; | 7 | @observable showServicesUpdatedInfoBar = false; |
@@ -24,10 +23,10 @@ export default class UIStore extends Store { | |||
24 | 23 | ||
25 | @computed get theme() { | 24 | @computed get theme() { |
26 | if (this.stores.settings.all.app.darkMode) { | 25 | if (this.stores.settings.all.app.darkMode) { |
27 | return Object.assign({}, themeDefault, themeDark); | 26 | return theme('dark'); |
28 | } | 27 | } |
29 | 28 | ||
30 | return themeDefault; | 29 | return theme('default'); |
31 | } | 30 | } |
32 | 31 | ||
33 | // Actions | 32 | // Actions |