diff --git a/src/main/ipc.ts b/src/main/ipc.ts index 192fe25..8c94343 100644 --- a/src/main/ipc.ts +++ b/src/main/ipc.ts @@ -82,10 +82,11 @@ handle(IpcEvents.MINIMIZE, e => { }); handle(IpcEvents.MAXIMIZE, e => { - if (globals.mainWin!.isMaximized()) { - globals.mainWin!.unmaximize(); + const mainWin = globals.mainWin!; + if (mainWin.isMaximized()) { + mainWin.unmaximize(); } else { - globals.mainWin!.maximize(); + mainWin.maximize(); } });