diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/stores/ServicesStore.js | 14 | ||||
-rw-r--r-- | src/webview/plugin.js | 6 |
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'; | 1 | import { action, reaction, computed, observable } from 'mobx'; |
2 | import { action, computed, observable } from 'mobx'; | ||
3 | import { debounce, remove } from 'lodash'; | 2 | import { debounce, remove } from 'lodash'; |
4 | // import path from 'path'; | ||
5 | // import fs from 'fs-extra'; | ||
6 | 3 | ||
7 | import Store from './lib/Store'; | 4 | import Store from './lib/Store'; |
8 | import Request from './lib/Request'; | 5 | import 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'; | |||
8 | import Spellchecker from './spellchecker'; | 8 | import Spellchecker from './spellchecker'; |
9 | import './notifications'; | 9 | import './notifications'; |
10 | 10 | ||
11 | const debug = require('debug')('Plugin'); | ||
12 | |||
11 | ipcRenderer.on('initializeRecipe', (e, data) => { | 13 | ipcRenderer.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 | ||
32 | ipcRenderer.on('settings-update', (e, data) => { | 35 | ipcRenderer.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 |