From 5398846e58d87f5ef54ccc19f4ccb318166ef621 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Wed, 28 Mar 2018 10:12:03 +0200 Subject: Replace share settings with webviews autorun with single key reaction --- src/stores/ServicesStore.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/stores/ServicesStore.js') 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 @@ -// import { remote } from 'electron'; -import { action, computed, observable } from 'mobx'; +import { action, reaction, computed, observable } from 'mobx'; import { debounce, remove } from 'lodash'; -// import path from 'path'; -// import fs from 'fs-extra'; import Store from './lib/Store'; import Request from './lib/Request'; @@ -63,13 +60,20 @@ export default class ServicesStore extends Store { this._mapActiveServiceToServiceModelReaction.bind(this), this._saveActiveService.bind(this), this._logoutReaction.bind(this), - this._shareSettingsWithServiceProcess.bind(this), ]); // Just bind this this._initializeServiceRecipeInWebview.bind(this); } + setup() { + // Single key reactions + reaction( + () => this.stores.settings.all.app.enableSpellchecking, + () => this._shareSettingsWithServiceProcess(), + ); + } + @computed get all() { if (this.stores.user.isLoggedIn) { const services = this.allServicesRequest.execute().result; -- cgit v1.2.3-54-g00ecf