aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/index.js b/src/index.js
index 338a8e795..7a0e89285 100644
--- a/src/index.js
+++ b/src/index.js
@@ -10,10 +10,10 @@ import path from 'path';
10import windowStateKeeper from 'electron-window-state'; 10import windowStateKeeper from 'electron-window-state';
11 11
12// Set app directory before loading user modules 12// Set app directory before loading user modules
13if (process.env.FERDI_APPDATA_DIR != null) { 13if (process.env.FERDI_APPDATA_DIR || process.env.PORTABLE_EXECUTABLE_DIR) {
14 app.setPath('appData', process.env.FERDI_APPDATA_DIR); 14 const appDataPath = process.env.FERDI_APPDATA_DIR || process.env.PORTABLE_EXECUTABLE_DIR;
15} else if (process.env.PORTABLE_EXECUTABLE_DIR != null) { 15 app.setPath('appData', appDataPath);
16 app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR); 16 app.setPath('userData', path.join(app.getPath('appData'), app.getName()));
17} 17}
18if (isDevMode) { 18if (isDevMode) {
19 app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`)); 19 app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`));
@@ -147,6 +147,13 @@ const createWindow = () => {
147 } 147 }
148 148
149 // Create the browser window. 149 // Create the browser window.
150 let backgroundColor = '#7367F0';
151 if (settings.get('accentColor') !== '#7367f0') {
152 backgroundColor = settings.get('accentColor');
153 } else if (settings.get('darkMode')) {
154 backgroundColor = '#1E1E1E';
155 }
156
150 mainWindow = new BrowserWindow({ 157 mainWindow = new BrowserWindow({
151 x: posX, 158 x: posX,
152 y: posY, 159 y: posY,
@@ -156,7 +163,7 @@ const createWindow = () => {
156 minHeight: 500, 163 minHeight: 500,
157 titleBarStyle: isMac ? 'hidden' : '', 164 titleBarStyle: isMac ? 'hidden' : '',
158 frame: isLinux, 165 frame: isLinux,
159 backgroundColor: !settings.get('darkMode') ? '#7367F0' : '#1E1E1E', 166 backgroundColor,
160 webPreferences: { 167 webPreferences: {
161 nodeIntegration: true, 168 nodeIntegration: true,
162 webviewTag: true, 169 webviewTag: true,