diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2022-12-26 13:26:12 +0530 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2022-12-26 13:26:12 +0530 |
commit | 5c350b370cbe8430582d25b062c8de19fdec033b (patch) | |
tree | 55db1e27efd7159ea7c4dc42c0e115b531bc3b83 /src/index.ts | |
parent | Upgrade 'nodejs' to '16.19.0' and 'pnpm' to '7.19.0' (diff) | |
download | ferdium-app-5c350b370cbe8430582d25b062c8de19fdec033b.tar.gz ferdium-app-5c350b370cbe8430582d25b062c8de19fdec033b.tar.zst ferdium-app-5c350b370cbe8430582d25b062c8de19fdec033b.zip |
Minor refactoring
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/index.ts b/src/index.ts index 08e81a2a8..bb6d64d1e 100644 --- a/src/index.ts +++ b/src/index.ts | |||
@@ -101,7 +101,7 @@ const retrieveSettingValue = (key: string, defaultValue: boolean | string) => | |||
101 | 101 | ||
102 | const liftSingleInstanceLock = retrieveSettingValue( | 102 | const liftSingleInstanceLock = retrieveSettingValue( |
103 | 'liftSingleInstanceLock', | 103 | 'liftSingleInstanceLock', |
104 | false, | 104 | DEFAULT_APP_SETTINGS.liftSingleInstanceLock, |
105 | ); | 105 | ); |
106 | 106 | ||
107 | // Force single window | 107 | // Force single window |
@@ -165,7 +165,12 @@ if ( | |||
165 | } | 165 | } |
166 | 166 | ||
167 | // Disable GPU acceleration | 167 | // Disable GPU acceleration |
168 | if (!retrieveSettingValue('enableGPUAcceleration', false)) { | 168 | if ( |
169 | !retrieveSettingValue( | ||
170 | 'enableGPUAcceleration', | ||
171 | DEFAULT_APP_SETTINGS.enableGPUAcceleration, | ||
172 | ) | ||
173 | ) { | ||
169 | debug('Disable GPU Acceleration'); | 174 | debug('Disable GPU Acceleration'); |
170 | app.disableHardwareAcceleration(); | 175 | app.disableHardwareAcceleration(); |
171 | } | 176 | } |
@@ -198,9 +203,15 @@ const createWindow = () => { | |||
198 | } | 203 | } |
199 | 204 | ||
200 | // Create the browser window. | 205 | // Create the browser window. |
201 | const backgroundColor = retrieveSettingValue('darkMode', false) | 206 | const backgroundColor = retrieveSettingValue( |
207 | 'darkMode', | ||
208 | DEFAULT_APP_SETTINGS.darkMode, | ||
209 | ) | ||
202 | ? '#1E1E1E' | 210 | ? '#1E1E1E' |
203 | : settings.get('accentColor'); | 211 | : (retrieveSettingValue( |
212 | 'accentColor', | ||
213 | DEFAULT_APP_SETTINGS.accentColor, | ||
214 | ) as string); | ||
204 | 215 | ||
205 | mainWindow = new BrowserWindow({ | 216 | mainWindow = new BrowserWindow({ |
206 | x: posX, | 217 | x: posX, |
@@ -217,7 +228,7 @@ const createWindow = () => { | |||
217 | spellcheck: retrieveSettingValue( | 228 | spellcheck: retrieveSettingValue( |
218 | 'enableSpellchecking', | 229 | 'enableSpellchecking', |
219 | DEFAULT_APP_SETTINGS.enableSpellchecking, | 230 | DEFAULT_APP_SETTINGS.enableSpellchecking, |
220 | ) as boolean | undefined, | 231 | ) as boolean, |
221 | nodeIntegration: true, | 232 | nodeIntegration: true, |
222 | contextIsolation: false, | 233 | contextIsolation: false, |
223 | webviewTag: true, | 234 | webviewTag: true, |