aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.js')
-rw-r--r--src/config.js42
1 files changed, 37 insertions, 5 deletions
diff --git a/src/config.js b/src/config.js
index b4705105d..283c20f84 100644
--- a/src/config.js
+++ b/src/config.js
@@ -1,8 +1,7 @@
1import electron from 'electron'; 1import electron from 'electron';
2import path from 'path';
3import isDevMode from 'electron-is-dev'; 2import isDevMode from 'electron-is-dev';
4import ms from 'ms'; 3import ms from 'ms';
5 4import path from 'path';
6import { asarPath } from './helpers/asar-helpers'; 5import { asarPath } from './helpers/asar-helpers';
7 6
8const app = process.type === 'renderer' ? electron.remote.app : electron.app; 7const app = process.type === 'renderer' ? electron.remote.app : electron.app;
@@ -14,6 +13,9 @@ export const LOCAL_API = 'http://localhost:3000';
14export const DEV_API = 'https://dev.franzinfra.com'; 13export const DEV_API = 'https://dev.franzinfra.com';
15export const LIVE_API = 'https://api.getferdi.com'; 14export const LIVE_API = 'https://api.getferdi.com';
16 15
16// URL used to submit debugger information, see https://github.com/getferdi/debugger
17export const DEBUG_API = 'https://debug.getferdi.com';
18
17export const LOCAL_WS_API = 'ws://localhost:3000'; 19export const LOCAL_WS_API = 'ws://localhost:3000';
18export const DEV_WS_API = 'wss://dev.franzinfra.com'; 20export const DEV_WS_API = 'wss://dev.franzinfra.com';
19export const LIVE_WS_API = 'wss://api.franzinfra.com'; 21export const LIVE_WS_API = 'wss://api.franzinfra.com';
@@ -43,6 +45,34 @@ export const HIBERNATION_STRATEGIES = {
43 3600: 'Extemely Slow Hibernation (1hour)', 45 3600: 'Extemely Slow Hibernation (1hour)',
44}; 46};
45 47
48export const NAVIGATION_BAR_BEHAVIOURS = {
49 custom: 'Show navigation bar on custom websites only',
50 always: 'Show navigation bar on all services',
51 never: 'Never show navigation bar',
52};
53
54export const SIDEBAR_WIDTH = {
55 35: 'Extemely slim sidebar',
56 45: 'Very slim sidebar',
57 55: 'Slim sidebar',
58 68: 'Normal sidebar',
59 80: 'Wide sidebar',
60 90: 'Very wide sidebar',
61 100: 'Extemely wide sidebar',
62};
63
64export const ICON_SIZES = {
65 0: 'Very small icons',
66 10: 'Small icons',
67 20: 'Normal icons',
68 30: 'Large icons',
69 40: 'Very large icons',
70};
71// We need a bias to push all icon sizes into positive numbers
72// otherwise the settings screen won't sort the sizes correctly.
73// The bias should always be the "Normal icons" value
74export const iconSizeBias = 20;
75
46export const DEFAULT_APP_SETTINGS = { 76export const DEFAULT_APP_SETTINGS = {
47 autoLaunchInBackground: false, 77 autoLaunchInBackground: false,
48 runInBackground: true, 78 runInBackground: true,
@@ -81,7 +111,9 @@ export const DEFAULT_APP_SETTINGS = {
81 adaptableDarkMode: true, 111 adaptableDarkMode: true,
82 accentColor: '#7367f0', 112 accentColor: '#7367f0',
83 serviceRibbonWidth: 68, 113 serviceRibbonWidth: 68,
114 iconSize: iconSizeBias,
84 sentry: false, 115 sentry: false,
116 navigationBarBehaviour: 'custom',
85}; 117};
86 118
87export const DEFAULT_FEATURES_CONFIG = { 119export const DEFAULT_FEATURES_CONFIG = {
@@ -123,11 +155,11 @@ if (process.env.FERDI_APPDATA_DIR != null) {
123 app.setPath('appData', process.env.FERDI_APPDATA_DIR); 155 app.setPath('appData', process.env.FERDI_APPDATA_DIR);
124 app.setPath('userData', path.join(app.getPath('appData'))); 156 app.setPath('userData', path.join(app.getPath('appData')));
125} else if (process.env.PORTABLE_EXECUTABLE_DIR != null) { 157} else if (process.env.PORTABLE_EXECUTABLE_DIR != null) {
126 app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.getName()}AppData`); 158 app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.name}AppData`);
127 app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}AppData`)); 159 app.setPath('userData', path.join(app.getPath('appData'), `${app.name}AppData`));
128} else if (process.platform === 'win32') { 160} else if (process.platform === 'win32') {
129 app.setPath('appData', process.env.APPDATA); 161 app.setPath('appData', process.env.APPDATA);
130 app.setPath('userData', path.join(app.getPath('appData'), app.getName())); 162 app.setPath('userData', path.join(app.getPath('appData'), app.name));
131} 163}
132 164
133export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); 165export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config');