Skip to content

Commit

Permalink
Combine repeated accesses to globals.mainWin!
Browse files Browse the repository at this point in the history
  • Loading branch information
alchzh committed Dec 21, 2023
1 parent a2eff72 commit 5d774ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});

Expand Down

0 comments on commit 5d774ad

Please sign in to comment.