mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-03-21 18:04:10 -05:00
Hide the dock icon on macOS when no windows are open
https://github.com/samuelthomas2774/nxapi/issues/18
This commit is contained in:
parent
a6b8dc33e8
commit
ce6272318e
|
|
@ -120,9 +120,18 @@ export async function init() {
|
|||
if (BrowserWindow.getAllWindows().length === 0) appinstance.showMainWindow();
|
||||
});
|
||||
|
||||
app.on('browser-window-created', () => {
|
||||
// Show the dock icon when any windows are open
|
||||
app.dock?.show();
|
||||
});
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
// Listen to the window-all-closed event to prevent Electron quitting the app
|
||||
// https://www.electronjs.org/docs/latest/api/app#event-window-all-closed
|
||||
|
||||
// Hide the dock icon when no windows are open
|
||||
// https://github.com/samuelthomas2774/nxapi/issues/18
|
||||
app.dock?.hide();
|
||||
});
|
||||
|
||||
debug('App started');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user