aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/components/services/content/ServiceWebview.js4
-rw-r--r--src/features/announcements/index.js4
-rw-r--r--src/features/appearance/index.js4
-rw-r--r--src/features/quickSwitch/Component.js8
-rwxr-xr-xsrc/features/settingsWS/index.js4
-rw-r--r--src/features/todos/index.js8
-rw-r--r--src/features/workspaces/index.js8
-rw-r--r--src/stores/ServicesStore.js61
-rw-r--r--src/stores/SettingsStore.js12
-rw-r--r--src/stores/UIStore.js8
10 files changed, 76 insertions, 45 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js
index 3b499a5db..c0f48793a 100644
--- a/src/components/services/content/ServiceWebview.js
+++ b/src/components/services/content/ServiceWebview.js
@@ -24,7 +24,9 @@ class ServiceWebview extends Component {
24 super(props); 24 super(props);
25 25
26 reaction( 26 reaction(
27 () => this.webview, 27 () => (
28 this.webview
29 ),
28 () => { 30 () => {
29 if (this.webview && this.webview.view) { 31 if (this.webview && this.webview.view) {
30 this.webview.view.addEventListener('console-message', (e) => { 32 this.webview.view.addEventListener('console-message', (e) => {
diff --git a/src/features/announcements/index.js b/src/features/announcements/index.js
index 28f0b10ed..19930c5b1 100644
--- a/src/features/announcements/index.js
+++ b/src/features/announcements/index.js
@@ -24,8 +24,6 @@ export default function initAnnouncements(stores, actions) {
24 announcementsStore.stop(); 24 announcementsStore.stop();
25 } 25 }
26 }, 26 },
27 { 27 { fireImmediately: true },
28 fireImmediately: true,
29 },
30 ); 28 );
31} 29}
diff --git a/src/features/appearance/index.js b/src/features/appearance/index.js
index 87651a3f4..c3425ba9c 100644
--- a/src/features/appearance/index.js
+++ b/src/features/appearance/index.js
@@ -235,8 +235,6 @@ export default function initAppearance(stores) {
235 () => { 235 () => {
236 updateStyle(settings.all.app); 236 updateStyle(settings.all.app);
237 }, 237 },
238 { 238 { fireImmediately: true },
239 fireImmediately: true,
240 },
241 ); 239 );
242} 240}
diff --git a/src/features/quickSwitch/Component.js b/src/features/quickSwitch/Component.js
index 812f2c04b..78d5d94a0 100644
--- a/src/features/quickSwitch/Component.js
+++ b/src/features/quickSwitch/Component.js
@@ -118,8 +118,12 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class
118 this.openService = this.openService.bind(this); 118 this.openService = this.openService.bind(this);
119 119
120 reaction( 120 reaction(
121 () => ModalState.isModalVisible, 121 () => (
122 this._handleVisibilityChange, 122 ModalState.isModalVisible
123 ),
124 () => {
125 this._handleVisibilityChange();
126 },
123 ); 127 );
124 } 128 }
125 129
diff --git a/src/features/settingsWS/index.js b/src/features/settingsWS/index.js
index 6711296da..7771421d6 100755
--- a/src/features/settingsWS/index.js
+++ b/src/features/settingsWS/index.js
@@ -22,8 +22,6 @@ export default function initSettingsWebSocket(stores, actions) {
22 settingsStore.stop(); 22 settingsStore.stop();
23 } 23 }
24 }, 24 },
25 { 25 { fireImmediately: true },
26 fireImmediately: true,
27 },
28 ); 26 );
29} 27}
diff --git a/src/features/todos/index.js b/src/features/todos/index.js
index 1c6c9179a..55956d1d7 100644
--- a/src/features/todos/index.js
+++ b/src/features/todos/index.js
@@ -13,7 +13,9 @@ export default function initTodos(stores, actions) {
13 13
14 // Toggle todos feature 14 // Toggle todos feature
15 reaction( 15 reaction(
16 () => features.features.isTodosEnabled, 16 () => (
17 features.features.isTodosEnabled
18 ),
17 (isEnabled) => { 19 (isEnabled) => {
18 if (isEnabled) { 20 if (isEnabled) {
19 debug('Initializing `todos` feature'); 21 debug('Initializing `todos` feature');
@@ -23,8 +25,6 @@ export default function initTodos(stores, actions) {
23 todosStore.stop(); 25 todosStore.stop();
24 } 26 }
25 }, 27 },
26 { 28 { fireImmediately: true },
27 fireImmediately: true,
28 },
29 ); 29 );
30} 30}
diff --git a/src/features/workspaces/index.js b/src/features/workspaces/index.js
index 3db6de5b2..83e4d9049 100644
--- a/src/features/workspaces/index.js
+++ b/src/features/workspaces/index.js
@@ -12,7 +12,9 @@ export default function initWorkspaces(stores, actions) {
12 12
13 // Toggle workspace feature 13 // Toggle workspace feature
14 reaction( 14 reaction(
15 () => features.features.isWorkspaceEnabled, 15 () => (
16 features.features.isWorkspaceEnabled
17 ),
16 (isEnabled) => { 18 (isEnabled) => {
17 if (isEnabled && !workspaceStore.isFeatureActive) { 19 if (isEnabled && !workspaceStore.isFeatureActive) {
18 debug('Initializing `workspaces` feature'); 20 debug('Initializing `workspaces` feature');
@@ -23,8 +25,6 @@ export default function initWorkspaces(stores, actions) {
23 resetApiRequests(); 25 resetApiRequests();
24 } 26 }
25 }, 27 },
26 { 28 { fireImmediately: true },
27 fireImmediately: true,
28 },
29 ); 29 );
30} 30}
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 }