diff --git a/app/src/electron.js b/app/src/electron.js index d930d350..b03f0537 100644 --- a/app/src/electron.js +++ b/app/src/electron.js @@ -154,6 +154,10 @@ ipcMain.on('app-started', async (event, arg) => { mainWindow.webContents.send('run-command', runCommandOnLoad); runCommandOnLoad = null; } + + if (initialConfig['winIsMaximized']) { + mainWindow.webContents.send('setIsMaximized', true); + } }); ipcMain.on('window-action', async (event, arg) => { if (!mainWindow) { @@ -166,10 +170,10 @@ ipcMain.on('window-action', async (event, arg) => { case 'maximize': if (mainWindow.isMaximized()) { mainWindow.unmaximize(); - mainWindow.webContents.send('maximize', false); + mainWindow.webContents.send('setIsMaximized', false); } else { mainWindow.maximize(); - mainWindow.webContents.send('maximize', true); + mainWindow.webContents.send('setIsMaximized', true); } break; case 'close': diff --git a/packages/web/src/widgets/TitleBar.svelte b/packages/web/src/widgets/TitleBar.svelte index 049a6147..e9f0c825 100644 --- a/packages/web/src/widgets/TitleBar.svelte +++ b/packages/web/src/widgets/TitleBar.svelte @@ -15,7 +15,7 @@ let isMaximized = false; if (electron) { - apiOn('maximize', (maximized: boolean) => { + apiOn('setIsMaximized', (maximized: boolean) => { isMaximized = maximized; }); }