aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2021-10-01 22:13:42 +0530
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2021-10-01 22:13:42 +0530
commitd4afc1eec9706d0027ad4b44421f8868688d1969 (patch)
tree3e43ed144c8f76f8c21f738d8c0703490c577afe /src
parentrefactor: split 'environment' into 'environment-remote' with only the remote ... (diff)
downloadferdium-app-d4afc1eec9706d0027ad4b44421f8868688d1969.tar.gz
ferdium-app-d4afc1eec9706d0027ad4b44421f8868688d1969.tar.zst
ferdium-app-d4afc1eec9706d0027ad4b44421f8868688d1969.zip
refactor: move 'DEFAULT_APP_SETTINGS' from 'environment' to 'config' since it doesn't depend on the running process any more.
Diffstat (limited to 'src')
-rw-r--r--src/components/settings/settings/EditSettingsForm.js3
-rw-r--r--src/config.ts58
-rw-r--r--src/containers/settings/EditSettingsScreen.js3
-rw-r--r--src/environment.ts67
-rw-r--r--src/features/appearance/index.ts3
-rw-r--r--src/index.js3
-rw-r--r--src/internal-server/app/Controllers/Http/UserController.js2
-rw-r--r--src/stores/AppStore.js3
-rw-r--r--src/stores/SettingsStore.js3
-rw-r--r--src/webview/recipe.js2
10 files changed, 69 insertions, 78 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js
index 819d0a9e6..123ab4c2d 100644
--- a/src/components/settings/settings/EditSettingsForm.js
+++ b/src/components/settings/settings/EditSettingsForm.js
@@ -12,9 +12,8 @@ import ToggleRaw from '../../ui/ToggleRaw';
12import Select from '../../ui/Select'; 12import Select from '../../ui/Select';
13import Input from '../../ui/Input'; 13import Input from '../../ui/Input';
14 14
15import { FRANZ_TRANSLATION, GITHUB_FRANZ_URL } from '../../../config'; 15import { DEFAULT_APP_SETTINGS, FRANZ_TRANSLATION, GITHUB_FRANZ_URL } from '../../../config';
16import { 16import {
17 DEFAULT_APP_SETTINGS,
18 isMac, 17 isMac,
19 isWindows, 18 isWindows,
20 lockFerdiShortcutKey, 19 lockFerdiShortcutKey,
diff --git a/src/config.ts b/src/config.ts
index 667b0a962..fe9145021 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -2,6 +2,8 @@
2 2
3import ms from 'ms'; 3import ms from 'ms';
4 4
5import { DEFAULT_ACCENT_COLOR } from '@meetfranz/theme';
6
5export const CHECK_INTERVAL = ms('1h'); // How often should we perform checks 7export const CHECK_INTERVAL = ms('1h'); // How often should we perform checks
6 8
7export const LOCAL_HOSTNAME = 'localhost'; 9export const LOCAL_HOSTNAME = 'localhost';
@@ -176,3 +178,59 @@ export const TODOS_PARTITION_ID = 'persist:todos';
176export const CUSTOM_WEBSITE_RECIPE_ID = 'franz-custom-website'; 178export const CUSTOM_WEBSITE_RECIPE_ID = 'franz-custom-website';
177 179
178export const DEFAULT_SERVICE_ORDER = 99; // something high enough that it gets added to the end of the already-added services on the left sidebar 180export const DEFAULT_SERVICE_ORDER = 99; // something high enough that it gets added to the end of the already-added services on the left sidebar
181
182export const DEFAULT_APP_SETTINGS = {
183 autoLaunchInBackground: false,
184 runInBackground: true,
185 reloadAfterResume: true,
186 enableSystemTray: true,
187 startMinimized: false,
188 confirmOnQuit: false,
189 minimizeToSystemTray: false,
190 closeToSystemTray: false,
191 privateNotifications: false,
192 clipboardNotifications: true,
193 notifyTaskBarOnMessage: false,
194 showDisabledServices: true,
195 showMessageBadgeWhenMuted: true,
196 showDragArea: false,
197 enableSpellchecking: true,
198 spellcheckerLanguage: 'en-us',
199 darkMode: false,
200 splitMode: false,
201 locale: '',
202 fallbackLocale: 'en-US',
203 beta: false,
204 isAppMuted: false,
205 enableGPUAcceleration: true,
206
207 // Ferdi specific options
208 server: LIVE_FERDI_API,
209 predefinedTodoServer: DEFAULT_TODO_SERVICE,
210 autohideMenuBar: false,
211 lockingFeatureEnabled: false,
212 locked: false,
213 lockedPassword: '',
214 useTouchIdToUnlock: true,
215 scheduledDNDEnabled: false,
216 scheduledDNDStart: '17:00',
217 scheduledDNDEnd: '09:00',
218 hibernateOnStartup: true,
219 hibernationStrategy: '300', // seconds
220 wakeUpStrategy: '300', // seconds
221 inactivityLock: 0,
222 automaticUpdates: true,
223 universalDarkMode: true,
224 userAgentPref: '',
225 adaptableDarkMode: true,
226 accentColor: DEFAULT_ACCENT_COLOR,
227 serviceRibbonWidth: 68,
228 iconSize: iconSizeBias,
229 sentry: false,
230 nightly: false,
231 navigationBarBehaviour: 'custom',
232 searchEngine: SEARCH_ENGINE_DDG,
233 useVerticalStyle: false,
234 alwaysShowWorkspaces: false,
235 liftSingleInstanceLock: false,
236};
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js
index 36b9e949b..1b05644f9 100644
--- a/src/containers/settings/EditSettingsScreen.js
+++ b/src/containers/settings/EditSettingsScreen.js
@@ -10,6 +10,7 @@ import TodosStore from '../../features/todos/store';
10import Form from '../../lib/Form'; 10import Form from '../../lib/Form';
11import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; 11import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages';
12import { 12import {
13 DEFAULT_APP_SETTINGS,
13 HIBERNATION_STRATEGIES, 14 HIBERNATION_STRATEGIES,
14 SIDEBAR_WIDTH, 15 SIDEBAR_WIDTH,
15 ICON_SIZES, 16 ICON_SIZES,
@@ -20,7 +21,7 @@ import {
20 DEFAULT_IS_FEATURE_ENABLED_BY_USER, 21 DEFAULT_IS_FEATURE_ENABLED_BY_USER,
21 WAKE_UP_STRATEGIES, 22 WAKE_UP_STRATEGIES,
22} from '../../config'; 23} from '../../config';
23import { DEFAULT_APP_SETTINGS, isMac } from '../../environment'; 24import { isMac } from '../../environment';
24 25
25import { getSelectOptions } from '../../helpers/i18n-helpers'; 26import { getSelectOptions } from '../../helpers/i18n-helpers';
26import { hash } from '../../helpers/password-helpers'; 27import { hash } from '../../helpers/password-helpers';
diff --git a/src/environment.ts b/src/environment.ts
index 99002367f..ce2a77e7a 100644
--- a/src/environment.ts
+++ b/src/environment.ts
@@ -1,13 +1,6 @@
1import os from 'os'; 1// Note: This file has now become devoid of all references to values deduced from the remote process - all those now live in the `environment-remote.js` file
2
3import { DEFAULT_ACCENT_COLOR } from '@meetfranz/theme';
4 2
5import { 3import os from 'os';
6 LIVE_FERDI_API,
7 DEFAULT_TODO_SERVICE,
8 SEARCH_ENGINE_DDG,
9 iconSizeBias,
10} from './config';
11 4
12export const isMac = process.platform === 'darwin'; 5export const isMac = process.platform === 'darwin';
13export const isWindows = process.platform === 'win32'; 6export const isWindows = process.platform === 'win32';
@@ -47,59 +40,3 @@ export const addNewServiceShortcutKey = (isAccelerator = true) =>
47 `${cmdOrCtrlShortcutKey(isAccelerator)}+N`; 40 `${cmdOrCtrlShortcutKey(isAccelerator)}+N`;
48export const settingsShortcutKey = (isAccelerator = true) => 41export const settingsShortcutKey = (isAccelerator = true) =>
49 `${cmdOrCtrlShortcutKey(isAccelerator)}+${isMac ? ',' : 'P'}`; 42 `${cmdOrCtrlShortcutKey(isAccelerator)}+${isMac ? ',' : 'P'}`;
50
51export const DEFAULT_APP_SETTINGS = {
52 autoLaunchInBackground: false,
53 runInBackground: true,
54 reloadAfterResume: true,
55 enableSystemTray: true,
56 startMinimized: false,
57 confirmOnQuit: false,
58 minimizeToSystemTray: false,
59 closeToSystemTray: false,
60 privateNotifications: false,
61 clipboardNotifications: true,
62 notifyTaskBarOnMessage: false,
63 showDisabledServices: true,
64 showMessageBadgeWhenMuted: true,
65 showDragArea: false,
66 enableSpellchecking: true,
67 spellcheckerLanguage: 'en-us',
68 darkMode: false,
69 splitMode: false,
70 locale: '',
71 fallbackLocale: 'en-US',
72 beta: false,
73 isAppMuted: false,
74 enableGPUAcceleration: true,
75
76 // Ferdi specific options
77 server: LIVE_FERDI_API,
78 predefinedTodoServer: DEFAULT_TODO_SERVICE,
79 autohideMenuBar: false,
80 lockingFeatureEnabled: false,
81 locked: false,
82 lockedPassword: '',
83 useTouchIdToUnlock: true,
84 scheduledDNDEnabled: false,
85 scheduledDNDStart: '17:00',
86 scheduledDNDEnd: '09:00',
87 hibernateOnStartup: true,
88 hibernationStrategy: '300', // seconds
89 wakeUpStrategy: '300', // seconds
90 inactivityLock: 0,
91 automaticUpdates: true,
92 universalDarkMode: true,
93 userAgentPref: '',
94 adaptableDarkMode: true,
95 accentColor: DEFAULT_ACCENT_COLOR,
96 serviceRibbonWidth: 68,
97 iconSize: iconSizeBias,
98 sentry: false,
99 nightly: false,
100 navigationBarBehaviour: 'custom',
101 searchEngine: SEARCH_ENGINE_DDG,
102 useVerticalStyle: false,
103 alwaysShowWorkspaces: false,
104 liftSingleInstanceLock: false,
105};
diff --git a/src/features/appearance/index.ts b/src/features/appearance/index.ts
index cb2f937eb..bb93507dc 100644
--- a/src/features/appearance/index.ts
+++ b/src/features/appearance/index.ts
@@ -1,7 +1,6 @@
1import color from 'color'; 1import color from 'color';
2import { reaction } from 'mobx'; 2import { reaction } from 'mobx';
3import { iconSizeBias } from '../../config'; 3import { DEFAULT_APP_SETTINGS, iconSizeBias } from '../../config';
4import { DEFAULT_APP_SETTINGS } from '../../environment';
5 4
6const STYLE_ELEMENT_ID = 'custom-appearance-style'; 5const STYLE_ELEMENT_ID = 'custom-appearance-style';
7 6
diff --git a/src/index.js b/src/index.js
index 6035d08a4..ed37134c9 100644
--- a/src/index.js
+++ b/src/index.js
@@ -10,10 +10,9 @@ import ms from 'ms';
10 10
11require('@electron/remote/main').initialize(); 11require('@electron/remote/main').initialize();
12 12
13import { DEFAULT_WINDOW_OPTIONS } from './config'; 13import { DEFAULT_APP_SETTINGS, DEFAULT_WINDOW_OPTIONS } from './config';
14 14
15import { 15import {
16 DEFAULT_APP_SETTINGS,
17 isMac, 16 isMac,
18 isWindows, 17 isWindows,
19 isLinux, 18 isLinux,
diff --git a/src/internal-server/app/Controllers/Http/UserController.js b/src/internal-server/app/Controllers/Http/UserController.js
index 9bbd2ff6e..25b5277bd 100644
--- a/src/internal-server/app/Controllers/Http/UserController.js
+++ b/src/internal-server/app/Controllers/Http/UserController.js
@@ -7,7 +7,7 @@ const btoa = require('btoa');
7const fetch = require('node-fetch'); 7const fetch = require('node-fetch');
8const { v4: uuid } = require('uuid'); 8const { v4: uuid } = require('uuid');
9const crypto = require('crypto'); 9const crypto = require('crypto');
10const { DEFAULT_APP_SETTINGS } = require('../../../../environment'); 10const { DEFAULT_APP_SETTINGS } = require('../../../../config');
11const { API_VERSION } = require('../../../../environment-remote'); 11const { API_VERSION } = require('../../../../environment-remote');
12const { default: userAgent } = require('../../../../helpers/userAgent-helpers'); 12const { default: userAgent } = require('../../../../helpers/userAgent-helpers');
13 13
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 83e6a899b..3d9d2b551 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -16,9 +16,8 @@ import { readJsonSync } from 'fs-extra';
16 16
17import Store from './lib/Store'; 17import Store from './lib/Store';
18import Request from './lib/Request'; 18import Request from './lib/Request';
19import { CHECK_INTERVAL } from '../config'; 19import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config';
20import { 20import {
21 DEFAULT_APP_SETTINGS,
22 isMac, 21 isMac,
23 electronVersion, 22 electronVersion,
24 osRelease, 23 osRelease,
diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js
index 4b203101a..ec80fee7c 100644
--- a/src/stores/SettingsStore.js
+++ b/src/stores/SettingsStore.js
@@ -2,8 +2,7 @@ import { ipcRenderer } from 'electron';
2import { getCurrentWindow } from '@electron/remote'; 2import { getCurrentWindow } from '@electron/remote';
3import { action, computed, observable, reaction } from 'mobx'; 3import { action, computed, observable, reaction } from 'mobx';
4import localStorage from 'mobx-localstorage'; 4import localStorage from 'mobx-localstorage';
5import { FILE_SYSTEM_SETTINGS_TYPES, LOCAL_SERVER } from '../config'; 5import { DEFAULT_APP_SETTINGS, FILE_SYSTEM_SETTINGS_TYPES, LOCAL_SERVER } from '../config';
6import { DEFAULT_APP_SETTINGS } from '../environment';
7import { hash } from '../helpers/password-helpers'; 6import { hash } from '../helpers/password-helpers';
8import Request from './lib/Request'; 7import Request from './lib/Request';
9import Store from './lib/Store'; 8import Store from './lib/Store';
diff --git a/src/webview/recipe.js b/src/webview/recipe.js
index 892b08e54..5cab28c09 100644
--- a/src/webview/recipe.js
+++ b/src/webview/recipe.js
@@ -45,7 +45,7 @@ import {
45 getSpellcheckerLocaleByFuzzyIdentifier, 45 getSpellcheckerLocaleByFuzzyIdentifier,
46} from './spellchecker'; 46} from './spellchecker';
47 47
48import { DEFAULT_APP_SETTINGS } from '../environment'; 48import { DEFAULT_APP_SETTINGS } from '../config';
49 49
50const debug = require('debug')('Ferdi:Plugin'); 50const debug = require('debug')('Ferdi:Plugin');
51 51