aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-21 20:12:28 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-21 21:55:28 +0530
commit4f584111d57e4d91ce189cf2f0b5c2e3e2b8dc4d (patch)
tree9f8b016d71136e87bcf532f60ce4acfa03f6cedd /src/stores
parentIncorrect position while adding a new service when there were pre-existing se... (diff)
downloadferdium-app-4f584111d57e4d91ce189cf2f0b5c2e3e2b8dc4d.tar.gz
ferdium-app-4f584111d57e4d91ce189cf2f0b5c2e3e2b8dc4d.tar.zst
ferdium-app-4f584111d57e4d91ce189cf2f0b5c2e3e2b8dc4d.zip
style: consistent syntax style [skip ci]
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/ServicesStore.js61
-rw-r--r--src/stores/SettingsStore.js12
-rw-r--r--src/stores/UIStore.js8
3 files changed, 56 insertions, 25 deletions
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';
10import CachedRequest from './lib/CachedRequest'; 10import CachedRequest from './lib/CachedRequest';
11import { matchRoute } from '../helpers/routing-helpers'; 11import { matchRoute } from '../helpers/routing-helpers';
12import { isInTimeframe } from '../helpers/schedule-helpers'; 12import { isInTimeframe } from '../helpers/schedule-helpers';
13import { 13import { getRecipeDirectory, getDevRecipeDirectory } from '../helpers/recipe-helpers';
14 getRecipeDirectory,
15 getDevRecipeDirectory,
16} from '../helpers/recipe-helpers';
17import { workspaceStore } from '../features/workspaces'; 14import { workspaceStore } from '../features/workspaces';
18import { KEEP_WS_LOADED_USID } from '../config'; 15import { KEEP_WS_LOADED_USID } from '../config';
19import { SPELLCHECKER_LOCALES } from '../i18n/languages'; 16import { SPELLCHECKER_LOCALES } from '../i18n/languages';
@@ -128,38 +125,66 @@ export default class ServicesStore extends Store {
128 setup() { 125 setup() {
129 // Single key reactions for the sake of your CPU 126 // Single key reactions for the sake of your CPU
130 reaction( 127 reaction(
131 () => this.stores.settings.app.enableSpellchecking, 128 () => (
132 () => this._shareSettingsWithServiceProcess(), 129 this.stores.settings.app.enableSpellchecking
130 ),
131 () => {
132 this._shareSettingsWithServiceProcess();
133 },
133 ); 134 );
134 135
135 reaction( 136 reaction(
136 () => this.stores.settings.app.spellcheckerLanguage, 137 () => (
137 () => this._shareSettingsWithServiceProcess(), 138 this.stores.settings.app.spellcheckerLanguage
139 ),
140 () => {
141 this._shareSettingsWithServiceProcess();
142 },
138 ); 143 );
139 144
140 reaction( 145 reaction(
141 () => this.stores.settings.app.darkMode, 146 () => (
142 () => this._shareSettingsWithServiceProcess(), 147 this.stores.settings.app.darkMode
148 ),
149 () => {
150 this._shareSettingsWithServiceProcess();
151 },
143 ); 152 );
144 153
145 reaction( 154 reaction(
146 () => this.stores.settings.app.adaptableDarkMode, 155 () => (
147 () => this._shareSettingsWithServiceProcess(), 156 this.stores.settings.app.adaptableDarkMode
157 ),
158 () => {
159 this._shareSettingsWithServiceProcess();
160 },
148 ); 161 );
149 162
150 reaction( 163 reaction(
151 () => this.stores.settings.app.universalDarkMode, 164 () => (
152 () => this._shareSettingsWithServiceProcess(), 165 this.stores.settings.app.universalDarkMode
166 ),
167 () => {
168 this._shareSettingsWithServiceProcess();
169 },
153 ); 170 );
154 171
155 reaction( 172 reaction(
156 () => this.stores.settings.app.searchEngine, 173 () => (
157 () => this._shareSettingsWithServiceProcess(), 174 this.stores.settings.app.searchEngine
175 ),
176 () => {
177 this._shareSettingsWithServiceProcess();
178 },
158 ); 179 );
159 180
160 reaction( 181 reaction(
161 () => this.stores.settings.app.clipboardNotifications, 182 () => (
162 () => this._shareSettingsWithServiceProcess(), 183 this.stores.settings.app.clipboardNotifications
184 ),
185 () => {
186 this._shareSettingsWithServiceProcess();
187 },
163 ); 188 );
164 } 189 }
165 190
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 {
40 await this._migrate(); 40 await this._migrate();
41 41
42 reaction( 42 reaction(
43 () => this.all.app.autohideMenuBar, 43 () => (
44 this.all.app.autohideMenuBar
45 ),
44 () => { 46 () => {
45 const currentWindow = getCurrentWindow(); 47 const currentWindow = getCurrentWindow();
46 currentWindow.setMenuBarVisibility(!this.all.app.autohideMenuBar); 48 currentWindow.setMenuBarVisibility(!this.all.app.autohideMenuBar);
@@ -49,15 +51,15 @@ export default class SettingsStore extends Store {
49 ); 51 );
50 52
51 reaction( 53 reaction(
52 () => this.all.app.server, 54 () => (
55 this.all.app.server
56 ),
53 (server) => { 57 (server) => {
54 if (server === LOCAL_SERVER) { 58 if (server === LOCAL_SERVER) {
55 ipcRenderer.send('startLocalServer'); 59 ipcRenderer.send('startLocalServer');
56 } 60 }
57 }, 61 },
58 { 62 { fireImmediately: true },
59 fireImmediately: true,
60 },
61 ); 63 );
62 64
63 // Inactivity lock timer 65 // 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 {
43 43
44 setup() { 44 setup() {
45 reaction( 45 reaction(
46 () => this.isDarkThemeActive, 46 () => (
47 () => this._setupThemeInDOM(), 47 this.isDarkThemeActive
48 ),
49 () => {
50 this._setupThemeInDOM();
51 },
48 { fireImmediately: true }, 52 { fireImmediately: true },
49 ); 53 );
50 } 54 }