mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-08-28 05:38:06 -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:
@@ -120,9 +120,18 @@ export async function init() {
|
|||||||
if (BrowserWindow.getAllWindows().length === 0) appinstance.showMainWindow();
|
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', () => {
|
app.on('window-all-closed', () => {
|
||||||
// Listen to the window-all-closed event to prevent Electron quitting the app
|
// 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
|
// 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');
|
debug('App started');
|
||||||
|
|||||||
Reference in New Issue
Block a user