mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
JS-4473: fix electron window close event
This commit is contained in:
parent
4b7e77cb96
commit
84f6e50a87
1 changed files with 7 additions and 7 deletions
14
electron.js
14
electron.js
|
@ -114,11 +114,15 @@ function createWindow () {
|
|||
|
||||
e.preventDefault();
|
||||
|
||||
let onClose = () => {
|
||||
is.macos ? mainWindow.hide() : Api.exit(mainWindow, '', false);
|
||||
};
|
||||
|
||||
if (mainWindow.isFullScreen()) {
|
||||
mainWindow.setFullScreen(false);
|
||||
mainWindow.once('leave-full-screen', () => mainWindow.hide());
|
||||
mainWindow.once('leave-full-screen', onClose);
|
||||
} else {
|
||||
mainWindow.hide();
|
||||
onClose();
|
||||
};
|
||||
return false;
|
||||
});
|
||||
|
@ -209,8 +213,4 @@ app.on('open-url', (e, url) => {
|
|||
Util.send(mainWindow, 'route', Util.getRouteFromUrl(url));
|
||||
mainWindow.show();
|
||||
};
|
||||
});
|
||||
|
||||
if (!is.macos) {
|
||||
app.on('window-all-closed', () => Api.exit(mainWindow, '', false));
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue