aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/ServicesStore.js16
-rw-r--r--src/stores/UIStore.js7
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 @@
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
@@ -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 @@
1import { action, observable, computed } from 'mobx'; 1import { action, observable, computed } from 'mobx';
2import theme from '@meetfranz/theme';
2 3
3import Store from './lib/Store'; 4import Store from './lib/Store';
4import * as themeDefault from '../theme/default';
5import * as themeDark from '../theme/dark';
6 5
7export default class UIStore extends Store { 6export 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