Skip to content

Commit

Permalink
feat: support "--toggle" cli argument when launching second instance
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Dec 13, 2024
1 parent 0344fe7 commit 82e2e24
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/Core/BrowserWindow/BrowserWindowModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ export class BrowserWindowModule {

ipcMain.on("escapePressed", () => shouldHideWindowOnEscapePressed() && browserWindowToggler.hide());

app.on("second-instance", () => browserWindowToggler.showAndFocus());
app.on("second-instance", (_, argv) => {
if (argv.includes("--toggle")) {
browserWindowToggler.toggle();
} else {
browserWindowToggler.showAndFocus();
}
});

BrowserWindowModule.registerUeliCommandEvents(browserWindow, eventSubscriber, browserWindowToggler);
}
Expand Down

0 comments on commit 82e2e24

Please sign in to comment.