diff options
Diffstat (limited to 'src/config.js')
-rw-r--r-- | src/config.js | 42 |
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 @@ | |||
1 | import electron from 'electron'; | 1 | import electron from 'electron'; |
2 | import path from 'path'; | ||
3 | import isDevMode from 'electron-is-dev'; | 2 | import isDevMode from 'electron-is-dev'; |
4 | import ms from 'ms'; | 3 | import ms from 'ms'; |
5 | 4 | import path from 'path'; | |
6 | import { asarPath } from './helpers/asar-helpers'; | 5 | import { asarPath } from './helpers/asar-helpers'; |
7 | 6 | ||
8 | const app = process.type === 'renderer' ? electron.remote.app : electron.app; | 7 | const app = process.type === 'renderer' ? electron.remote.app : electron.app; |
@@ -14,6 +13,9 @@ export const LOCAL_API = 'http://localhost:3000'; | |||
14 | export const DEV_API = 'https://dev.franzinfra.com'; | 13 | export const DEV_API = 'https://dev.franzinfra.com'; |
15 | export const LIVE_API = 'https://api.getferdi.com'; | 14 | export const LIVE_API = 'https://api.getferdi.com'; |
16 | 15 | ||
16 | // URL used to submit debugger information, see https://github.com/getferdi/debugger | ||
17 | export const DEBUG_API = 'https://debug.getferdi.com'; | ||
18 | |||
17 | export const LOCAL_WS_API = 'ws://localhost:3000'; | 19 | export const LOCAL_WS_API = 'ws://localhost:3000'; |
18 | export const DEV_WS_API = 'wss://dev.franzinfra.com'; | 20 | export const DEV_WS_API = 'wss://dev.franzinfra.com'; |
19 | export const LIVE_WS_API = 'wss://api.franzinfra.com'; | 21 | export 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 | ||
48 | export 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 | |||
54 | export 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 | |||
64 | export 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 | ||
74 | export const iconSizeBias = 20; | ||
75 | |||
46 | export const DEFAULT_APP_SETTINGS = { | 76 | export 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 | ||
87 | export const DEFAULT_FEATURES_CONFIG = { | 119 | export 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 | ||
133 | export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); | 165 | export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); |