Skip to content

Commit

Permalink
second-instance electron fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
JasminDreasond committed Aug 26, 2024
1 parent 95b373b commit 7e8aa83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@ if (!gotTheLock) {
if (electronCache.win.isMinimized()) {
electronCache.win.restore();
}
electronCache.win?.show();
electronCache.win?.focus();
appShow.change(true);
}
});

Expand Down Expand Up @@ -392,7 +394,9 @@ app.on('second-instance', () => {
if (electronCache.win) {
// Focus on the main window if the user tried to open another
if (electronCache.win.isMinimized()) electronCache.win.restore();
electronCache.win.show();
electronCache.win.focus();
appShow.change(true);
}
});

Expand Down

0 comments on commit 7e8aa83

Please sign in to comment.