summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/stores/ServicesStore.js14
-rw-r--r--src/webview/plugin.js6
2 files changed, 14 insertions, 6 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index 6dfc114f5..ccb85421a 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -1,8 +1,5 @@
1// import { remote } from 'electron'; 1import { action, reaction, computed, observable } from 'mobx';
2import { action, computed, observable } from 'mobx';
3import { debounce, remove } from 'lodash'; 2import { debounce, remove } from 'lodash';
4// import path from 'path';
5// import fs from 'fs-extra';
6 3
7import Store from './lib/Store'; 4import Store from './lib/Store';
8import Request from './lib/Request'; 5import Request from './lib/Request';
@@ -63,13 +60,20 @@ export default class ServicesStore extends Store {
63 this._mapActiveServiceToServiceModelReaction.bind(this), 60 this._mapActiveServiceToServiceModelReaction.bind(this),
64 this._saveActiveService.bind(this), 61 this._saveActiveService.bind(this),
65 this._logoutReaction.bind(this), 62 this._logoutReaction.bind(this),
66 this._shareSettingsWithServiceProcess.bind(this),
67 ]); 63 ]);
68 64
69 // Just bind this 65 // Just bind this
70 this._initializeServiceRecipeInWebview.bind(this); 66 this._initializeServiceRecipeInWebview.bind(this);
71 } 67 }
72 68
69 setup() {
70 // Single key reactions
71 reaction(
72 () => this.stores.settings.all.app.enableSpellchecking,
73 () => this._shareSettingsWithServiceProcess(),
74 );
75 }
76
73 @computed get all() { 77 @computed get all() {
74 if (this.stores.user.isLoggedIn) { 78 if (this.stores.user.isLoggedIn) {
75 const services = this.allServicesRequest.execute().result; 79 const services = this.allServicesRequest.execute().result;
diff --git a/src/webview/plugin.js b/src/webview/plugin.js
index 52b19b3fd..c6530fef6 100644
--- a/src/webview/plugin.js
+++ b/src/webview/plugin.js
@@ -8,6 +8,8 @@ import RecipeWebview from './lib/RecipeWebview';
8import Spellchecker from './spellchecker'; 8import Spellchecker from './spellchecker';
9import './notifications'; 9import './notifications';
10 10
11const debug = require('debug')('Plugin');
12
11ipcRenderer.on('initializeRecipe', (e, data) => { 13ipcRenderer.on('initializeRecipe', (e, data) => {
12 const modulePath = path.join(data.recipe.path, 'webview.js'); 14 const modulePath = path.join(data.recipe.path, 'webview.js');
13 // Delete module from cache 15 // Delete module from cache
@@ -15,8 +17,9 @@ ipcRenderer.on('initializeRecipe', (e, data) => {
15 try { 17 try {
16 // eslint-disable-next-line 18 // eslint-disable-next-line
17 require(modulePath)(new RecipeWebview(), data); 19 require(modulePath)(new RecipeWebview(), data);
20 debug('Initialize Recipe');
18 } catch (err) { 21 } catch (err) {
19 console.error(err); 22 debug('Recipe initialization failed', err);
20 } 23 }
21}); 24});
22 25
@@ -31,6 +34,7 @@ new ContextMenuListener((info) => { // eslint-disable-line
31 34
32ipcRenderer.on('settings-update', (e, data) => { 35ipcRenderer.on('settings-update', (e, data) => {
33 spellchecker.toggleSpellchecker(data.enableSpellchecking); 36 spellchecker.toggleSpellchecker(data.enableSpellchecking);
37 debug('Settings update received', data);
34}); 38});
35 39
36// initSpellche 40// initSpellche