aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-10-22 10:32:15 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-10-22 10:32:15 +0200
commit806b0a086312ca12ed46bc1a634be6694e277308 (patch)
treee31e95d3bb69a01a6bcf5a8df6b575f6fafe5cc3
parentbeautify settings (diff)
downloadferdium-app-806b0a086312ca12ed46bc1a634be6694e277308.tar.gz
ferdium-app-806b0a086312ca12ed46bc1a634be6694e277308.tar.zst
ferdium-app-806b0a086312ca12ed46bc1a634be6694e277308.zip
Add `liftSingleInstanceLock` to settings
-rw-r--r--src/index.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/index.js b/src/index.js
index 7de7a5e1c..3056a8bec 100644
--- a/src/index.js
+++ b/src/index.js
@@ -64,8 +64,15 @@ if (isWindows) {
64 app.setAppUserModelId(appId); 64 app.setAppUserModelId(appId);
65} 65}
66 66
67// Initialize Settings
68const settings = new Settings('app', DEFAULT_APP_SETTINGS);
69const proxySettings = new Settings('proxy');
70
71// add `liftSingleInstanceLock` to settings.json to override the single instance lock
72const liftSingleInstanceLock = settings.get('liftSingleInstanceLock') || false;
73
67// Force single window 74// Force single window
68const gotTheLock = app.requestSingleInstanceLock(); 75const gotTheLock = liftSingleInstanceLock ? true : app.requestSingleInstanceLock();
69if (!gotTheLock) { 76if (!gotTheLock) {
70 app.quit(); 77 app.quit();
71} else { 78} else {
@@ -112,10 +119,6 @@ if (isLinux && ['Pantheon', 'Unity:Unity7'].indexOf(process.env.XDG_CURRENT_DESK
112 process.env.XDG_CURRENT_DESKTOP = 'Unity'; 119 process.env.XDG_CURRENT_DESKTOP = 'Unity';
113} 120}
114 121
115// Initialize Settings
116const settings = new Settings('app', DEFAULT_APP_SETTINGS);
117const proxySettings = new Settings('proxy');
118
119// Disable GPU acceleration 122// Disable GPU acceleration
120if (!settings.get('enableGPUAcceleration')) { 123if (!settings.get('enableGPUAcceleration')) {
121 debug('Disable GPU Acceleration'); 124 debug('Disable GPU Acceleration');