diff options
author | 2023-07-30 11:23:57 -0600 | |
---|---|---|
committer | 2023-07-30 23:57:51 +0000 | |
commit | b35dd897a94d98faeee84645ca885114494e45c0 (patch) | |
tree | ddb0610e24a628f2a5960950480363b8e94bd82a /src/index.ts | |
parent | refactor: more lint improvements (diff) | |
download | ferdium-app-b35dd897a94d98faeee84645ca885114494e45c0.tar.gz ferdium-app-b35dd897a94d98faeee84645ca885114494e45c0.tar.zst ferdium-app-b35dd897a94d98faeee84645ca885114494e45c0.zip |
- convert require statement to dynamic import in index.ts
- import color from darkThemeGrayDarkest instead of hardcoding it in index.ts
- convert require statement to dynamic import in dnd.ts
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/index.ts b/src/index.ts index 5507a9ac4..e76298dec 100644 --- a/src/index.ts +++ b/src/index.ts | |||
@@ -16,6 +16,7 @@ import windowStateKeeper from 'electron-window-state'; | |||
16 | import minimist from 'minimist'; | 16 | import minimist from 'minimist'; |
17 | import ms from 'ms'; | 17 | import ms from 'ms'; |
18 | import { EventEmitter } from 'node:events'; | 18 | import { EventEmitter } from 'node:events'; |
19 | import { initialize } from 'electron-react-titlebar/main'; | ||
19 | import { enableWebContents, initializeRemote } from './electron-util'; | 20 | import { enableWebContents, initializeRemote } from './electron-util'; |
20 | import enforceMacOSAppLocation from './enforce-macos-app-location'; | 21 | import enforceMacOSAppLocation from './enforce-macos-app-location'; |
21 | 22 | ||
@@ -47,6 +48,7 @@ import { asarPath } from './helpers/asar-helpers'; | |||
47 | import { openExternalUrl } from './helpers/url-helpers'; | 48 | import { openExternalUrl } from './helpers/url-helpers'; |
48 | import userAgent from './helpers/userAgent-helpers'; | 49 | import userAgent from './helpers/userAgent-helpers'; |
49 | import { translateTo } from './helpers/translation-helpers'; | 50 | import { translateTo } from './helpers/translation-helpers'; |
51 | import { darkThemeGrayDarkest } from './themes/legacy'; | ||
50 | 52 | ||
51 | const debug = require('./preload-safe-debug')('Ferdium:App'); | 53 | const debug = require('./preload-safe-debug')('Ferdium:App'); |
52 | 54 | ||
@@ -199,7 +201,7 @@ const createWindow = () => { | |||
199 | 'darkMode', | 201 | 'darkMode', |
200 | DEFAULT_APP_SETTINGS.darkMode, | 202 | DEFAULT_APP_SETTINGS.darkMode, |
201 | ) | 203 | ) |
202 | ? '#1E1E1E' | 204 | ? darkThemeGrayDarkest |
203 | : (retrieveSettingValue( | 205 | : (retrieveSettingValue( |
204 | 'accentColor', | 206 | 'accentColor', |
205 | DEFAULT_APP_SETTINGS.accentColor, | 207 | DEFAULT_APP_SETTINGS.accentColor, |
@@ -389,9 +391,11 @@ const createWindow = () => { | |||
389 | }); | 391 | }); |
390 | 392 | ||
391 | if (isMac) { | 393 | if (isMac) { |
392 | // eslint-disable-next-line global-require | 394 | import('./electron/macOSPermissions').then(macOSPermissions => { |
393 | const { askFormacOSPermissions } = require('./electron/macOSPermissions'); | 395 | const { askFormacOSPermissions } = macOSPermissions; |
394 | setTimeout(() => askFormacOSPermissions(mainWindow), ms('30s')); | 396 | |
397 | setTimeout(() => askFormacOSPermissions(mainWindow!), ms('30s')); | ||
398 | }); | ||
395 | } | 399 | } |
396 | 400 | ||
397 | mainWindow.on('show', () => { | 401 | mainWindow.on('show', () => { |
@@ -498,8 +502,7 @@ app.on('ready', () => { | |||
498 | ]); | 502 | ]); |
499 | } | 503 | } |
500 | 504 | ||
501 | // eslint-disable-next-line global-require | 505 | initialize(); |
502 | require('electron-react-titlebar/main').initialize(); | ||
503 | 506 | ||
504 | createWindow(); | 507 | createWindow(); |
505 | }); | 508 | }); |