From ab74b7ed2ee89dc4ab6dfefdf42a579a8e0790a8 Mon Sep 17 00:00:00 2001 From: leejooy96 Date: Mon, 23 Jun 2025 16:14:21 +0900 Subject: [PATCH] refactor: cleanup codes --- src/main/MainRunner.ts | 2 +- src/main/utils/Constants.ts | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/MainRunner.ts b/src/main/MainRunner.ts index bac6aba..cb8a8aa 100644 --- a/src/main/MainRunner.ts +++ b/src/main/MainRunner.ts @@ -78,7 +78,7 @@ export const createMainWindow = async (): Promise => { }) mainWindow.webContents.on('did-frame-finish-load', (): void => { - if (Constants.IS_DEV_ENV && Constants.IS_DEVTOOLS) { + if (Constants.IS_DEV_ENV && Constants.FEAT_OPEN_DEV_TOOLS_AT_START) { mainWindow.webContents.openDevTools() } }) diff --git a/src/main/utils/Constants.ts b/src/main/utils/Constants.ts index 2a08571..5ac1623 100644 --- a/src/main/utils/Constants.ts +++ b/src/main/utils/Constants.ts @@ -14,6 +14,21 @@ export interface TrayOptions { } export default class Constants { + /* ------------------------------------------------------ + * Vutron app feature list + * + * This template includes examples so you can try out several Electron features. + * To remove them from your project, you'll need to disable the features below, or find and delete the related code. + * ------------------------------------------------------ */ + static FEAT_APP_LOGGER = true + + // To show devtools at startup. It requires IS_DEV_ENV=true. + // Note: For debugging purpose, window won't be closed if click elsewhere, if devtools is open. + static FEAT_OPEN_DEV_TOOLS_AT_START = true + /* ------------------------------------------------------ + * END OF FEATURES + * ------------------------------------------------------ */ + // Display app name (uppercase first letter) static APP_NAME = name.charAt(0).toUpperCase() + name.slice(1) @@ -25,10 +40,6 @@ export default class Constants { ? resolve(__dirname, '../../src/public') : resolve(__dirname, '..') - // To show devtools at startup. It requires IS_DEV_ENV=true. - // Note: For debugging purpose, window won't be closed if click elsewhere, if devtools is open. - static IS_DEVTOOLS = true - static IS_MAC = process.platform === 'darwin' static DEFAULT_WEB_PREFERENCES = {