aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.js
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2020-01-31 21:03:49 +0100
committerLibravatar vantezzen <hello@vantezzen.io>2020-01-31 21:03:49 +0100
commitd54ceb639862788c053e21f217ca39ac36003db6 (patch)
tree40bfd8bb6a8a85c222f9c67d7dd862a835394e80 /src/config.js
parentAdd publish debug log option (diff)
parentMerge branch 'develop' of https://github.com/getferdi/ferdi into develop (diff)
downloadferdium-app-d54ceb639862788c053e21f217ca39ac36003db6.tar.gz
ferdium-app-d54ceb639862788c053e21f217ca39ac36003db6.tar.zst
ferdium-app-d54ceb639862788c053e21f217ca39ac36003db6.zip
Merge branch 'develop' into publish-debug
Diffstat (limited to 'src/config.js')
-rw-r--r--src/config.js25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/config.js b/src/config.js
index 834f89d01..d5f7a706b 100644
--- a/src/config.js
+++ b/src/config.js
@@ -6,7 +6,7 @@ import ms from 'ms';
6import { asarPath } from './helpers/asar-helpers'; 6import { asarPath } from './helpers/asar-helpers';
7 7
8const app = process.type === 'renderer' ? electron.remote.app : electron.app; 8const app = process.type === 'renderer' ? electron.remote.app : electron.app;
9const systemPreferences = process.type === 'renderer' ? electron.remote.systemPreferences : electron.systemPreferences; 9const nativeTheme = process.type === 'renderer' ? electron.remote.nativeTheme : electron.nativeTheme;
10 10
11export const CHECK_INTERVAL = ms('1h'); // How often should we perform checks 11export const CHECK_INTERVAL = ms('1h'); // How often should we perform checks
12 12
@@ -33,7 +33,6 @@ export const DEVELOPMENT_TODOS_FRONTEND_URL = 'https://development--franz-todos.
33 33
34export const GA_ID = !isDevMode ? 'UA-74126766-10' : 'UA-74126766-12'; 34export const GA_ID = !isDevMode ? 'UA-74126766-10' : 'UA-74126766-12';
35 35
36export const DEFAULT_LOCK_PASSWORD = 'ferdi';
37export const KEEP_WS_LOADED_USID = '0a0aa000-0a0a-49a0-a000-a0a0a0a0a0a0'; 36export const KEEP_WS_LOADED_USID = '0a0aa000-0a0a-49a0-a000-a0a0a0a0a0a0';
38 37
39export const HIBERNATION_STRATEGIES = { 38export const HIBERNATION_STRATEGIES = {
@@ -50,13 +49,14 @@ export const DEFAULT_APP_SETTINGS = {
50 autoLaunchInBackground: false, 49 autoLaunchInBackground: false,
51 runInBackground: true, 50 runInBackground: true,
52 enableSystemTray: true, 51 enableSystemTray: true,
52 startMinimized: false,
53 minimizeToSystemTray: false, 53 minimizeToSystemTray: false,
54 privateNotifications: false, 54 privateNotifications: false,
55 showDisabledServices: true, 55 showDisabledServices: true,
56 showMessageBadgeWhenMuted: true, 56 showMessageBadgeWhenMuted: true,
57 enableSpellchecking: true, 57 enableSpellchecking: true,
58 spellcheckerLanguage: 'en-us', 58 spellcheckerLanguage: 'en-us',
59 darkMode: process.platform === 'darwin' ? systemPreferences.isDarkMode() : false, // We can't use refs from `./environment` at this time 59 darkMode: process.platform === 'darwin' ? nativeTheme.shouldUseDarkColors : false, // We can't use refs from `./environment` at this time
60 locale: '', 60 locale: '',
61 fallbackLocale: 'en-US', 61 fallbackLocale: 'en-US',
62 beta: false, 62 beta: false,
@@ -66,7 +66,8 @@ export const DEFAULT_APP_SETTINGS = {
66 66
67 // Ferdi specific options 67 // Ferdi specific options
68 server: LIVE_API, 68 server: LIVE_API,
69 todoServer: PRODUCTION_TODOS_FRONTEND_URL, 69 // todoServer: PRODUCTION_TODOS_FRONTEND_URL,
70 todoServer: "https://todoist.com/app",
70 autohideMenuBar: false, 71 autohideMenuBar: false,
71 lockingFeatureEnabled: false, 72 lockingFeatureEnabled: false,
72 locked: false, 73 locked: false,
@@ -76,10 +77,14 @@ export const DEFAULT_APP_SETTINGS = {
76 scheduledDNDEnd: '09:00', 77 scheduledDNDEnd: '09:00',
77 hibernate: false, 78 hibernate: false,
78 hibernationStrategy: 300, 79 hibernationStrategy: 300,
80 inactivityLock: 0,
79 noUpdates: false, 81 noUpdates: false,
80 showServiceNavigationBar: false, 82 showServiceNavigationBar: false,
81 universalDarkMode: true, 83 universalDarkMode: true,
84 adaptableDarkMode: true,
82 accentColor: '#7367f0', 85 accentColor: '#7367f0',
86 serviceRibbonWidth: 68,
87 sentry: false,
83}; 88};
84 89
85export const DEFAULT_FEATURES_CONFIG = { 90export const DEFAULT_FEATURES_CONFIG = {
@@ -116,6 +121,18 @@ export const FILE_SYSTEM_SETTINGS_TYPES = [
116export const LOCAL_SERVER = 'You are using Ferdi without a server'; 121export const LOCAL_SERVER = 'You are using Ferdi without a server';
117export const SERVER_NOT_LOADED = 'Ferdi::SERVER_NOT_LOADED'; 122export const SERVER_NOT_LOADED = 'Ferdi::SERVER_NOT_LOADED';
118 123
124// Set app directory before loading user modules
125if (process.env.FERDI_APPDATA_DIR != null) {
126 app.setPath('appData', process.env.FERDI_APPDATA_DIR);
127 app.setPath('userData', path.join(app.getPath('appData')));
128} else if (process.env.PORTABLE_EXECUTABLE_DIR != null) {
129 app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.getName()}AppData`);
130 app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}AppData`));
131} else if (process.platform === 'win32') {
132 app.setPath('appData', process.env.APPDATA);
133 app.setPath('userData', path.join(app.getPath('appData'), app.getName()));
134}
135
119export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); 136export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config');
120 137
121// Replacing app.asar is not beautiful but unforunately necessary 138// Replacing app.asar is not beautiful but unforunately necessary