From 6de0ecb84fcae0f77e65b2475d58208dc42e0718 Mon Sep 17 00:00:00 2001 From: KatoakDR <68095633+KatoakDR@users.noreply.github.com> Date: Sat, 30 Dec 2023 22:52:57 -0600 Subject: [PATCH] feat: clarify its the main window; debug messages --- electron/main/app.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/electron/main/app.ts b/electron/main/app.ts index e0452a18..702521a1 100644 --- a/electron/main/app.ts +++ b/electron/main/app.ts @@ -49,7 +49,7 @@ if (appEnvIsProd) { let ipcController: IpcController; -const createWindow = async (): Promise => { +const createMainWindow = async (): Promise => { if (appEnvIsDev) { // If running in development, serve the renderer from localhost. // This must be done once the app is ready. @@ -86,7 +86,7 @@ const createWindow = async (): Promise => { // Once the window has finished loading, show it. mainWindow.webContents.once('did-finish-load', () => { - logger.info('showing window'); + logger.info('showing main window'); mainWindow.show(); }); @@ -101,6 +101,7 @@ const createWindow = async (): Promise => { ipcController = newIpcController({ dispatch }); + logger.info('loading main window', { appUrl }); await mainWindow.loadURL(appUrl); initializeMenu(mainWindow); @@ -109,7 +110,7 @@ const createWindow = async (): Promise => { // Prepare the renderer once the app is ready app.on('ready', () => { runInBackground(async () => { - await createWindow(); + await createMainWindow(); }); }); @@ -155,6 +156,7 @@ app.on('web-contents-created', (_, contents) => { }); app.on('window-all-closed', (): void => { + logger.debug('windows all closed, quitting app'); app.quit(); }); @@ -177,6 +179,7 @@ app.on('before-quit', (event: Event): void => { event.preventDefault(); beforeQuitActionStatus = BeforeQuitActionStatus.IN_PROGRESS; runInBackground(async () => { + logger.debug('performing before-quit operations'); await ipcController?.destroy(); beforeQuitActionStatus = BeforeQuitActionStatus.COMPLETED; app.quit(); @@ -193,5 +196,6 @@ app.on('before-quit', (event: Event): void => { }); app.on('quit', (): void => { + logger.debug('quitting app'); logger.info('until next time, brave adventurer'); });