From 5d774ad325a995883a5af1703eecc52e15a72b79 Mon Sep 17 00:00:00 2001 From: Albert Zhang Date: Mon, 4 Dec 2023 07:10:47 -0500 Subject: [PATCH] Combine repeated accesses to globals.mainWin! --- src/main/ipc.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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(); } });