From 4f584111d57e4d91ce189cf2f0b5c2e3e2b8dc4d Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sat, 21 Aug 2021 20:12:28 +0530 Subject: style: consistent syntax style [skip ci] --- src/stores/ServicesStore.js | 61 ++++++++++++++++++++++++++++++++------------- src/stores/SettingsStore.js | 12 +++++---- src/stores/UIStore.js | 8 ++++-- 3 files changed, 56 insertions(+), 25 deletions(-) (limited to 'src/stores') diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 2ec6a0a68..06f33cc1e 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js @@ -10,10 +10,7 @@ import Request from './lib/Request'; import CachedRequest from './lib/CachedRequest'; import { matchRoute } from '../helpers/routing-helpers'; import { isInTimeframe } from '../helpers/schedule-helpers'; -import { - getRecipeDirectory, - getDevRecipeDirectory, -} from '../helpers/recipe-helpers'; +import { getRecipeDirectory, getDevRecipeDirectory } from '../helpers/recipe-helpers'; import { workspaceStore } from '../features/workspaces'; import { KEEP_WS_LOADED_USID } from '../config'; import { SPELLCHECKER_LOCALES } from '../i18n/languages'; @@ -128,38 +125,66 @@ export default class ServicesStore extends Store { setup() { // Single key reactions for the sake of your CPU reaction( - () => this.stores.settings.app.enableSpellchecking, - () => this._shareSettingsWithServiceProcess(), + () => ( + this.stores.settings.app.enableSpellchecking + ), + () => { + this._shareSettingsWithServiceProcess(); + }, ); reaction( - () => this.stores.settings.app.spellcheckerLanguage, - () => this._shareSettingsWithServiceProcess(), + () => ( + this.stores.settings.app.spellcheckerLanguage + ), + () => { + this._shareSettingsWithServiceProcess(); + }, ); reaction( - () => this.stores.settings.app.darkMode, - () => this._shareSettingsWithServiceProcess(), + () => ( + this.stores.settings.app.darkMode + ), + () => { + this._shareSettingsWithServiceProcess(); + }, ); reaction( - () => this.stores.settings.app.adaptableDarkMode, - () => this._shareSettingsWithServiceProcess(), + () => ( + this.stores.settings.app.adaptableDarkMode + ), + () => { + this._shareSettingsWithServiceProcess(); + }, ); reaction( - () => this.stores.settings.app.universalDarkMode, - () => this._shareSettingsWithServiceProcess(), + () => ( + this.stores.settings.app.universalDarkMode + ), + () => { + this._shareSettingsWithServiceProcess(); + }, ); reaction( - () => this.stores.settings.app.searchEngine, - () => this._shareSettingsWithServiceProcess(), + () => ( + this.stores.settings.app.searchEngine + ), + () => { + this._shareSettingsWithServiceProcess(); + }, ); reaction( - () => this.stores.settings.app.clipboardNotifications, - () => this._shareSettingsWithServiceProcess(), + () => ( + this.stores.settings.app.clipboardNotifications + ), + () => { + this._shareSettingsWithServiceProcess(); + }, ); } diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js index cd627c2b8..f551e1e49 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js @@ -40,7 +40,9 @@ export default class SettingsStore extends Store { await this._migrate(); reaction( - () => this.all.app.autohideMenuBar, + () => ( + this.all.app.autohideMenuBar + ), () => { const currentWindow = getCurrentWindow(); currentWindow.setMenuBarVisibility(!this.all.app.autohideMenuBar); @@ -49,15 +51,15 @@ export default class SettingsStore extends Store { ); reaction( - () => this.all.app.server, + () => ( + this.all.app.server + ), (server) => { if (server === LOCAL_SERVER) { ipcRenderer.send('startLocalServer'); } }, - { - fireImmediately: true, - }, + { fireImmediately: true }, ); // Inactivity lock timer diff --git a/src/stores/UIStore.js b/src/stores/UIStore.js index adcd776c1..be675d5ed 100644 --- a/src/stores/UIStore.js +++ b/src/stores/UIStore.js @@ -43,8 +43,12 @@ export default class UIStore extends Store { setup() { reaction( - () => this.isDarkThemeActive, - () => this._setupThemeInDOM(), + () => ( + this.isDarkThemeActive + ), + () => { + this._setupThemeInDOM(); + }, { fireImmediately: true }, ); } -- cgit v1.2.3-70-g09d2