Combine repeated accesses to globals.mainWin!

This commit is contained in:
Albert Zhang 2023-12-04 07:10:47 -05:00
parent a2eff72147
commit 5d774ad325
No known key found for this signature in database
GPG key ID: D74C859E94CA6DDC

View file

@ -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();
}
});