1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

#267: graceful shutdown

This commit is contained in:
Andrew Simachev 2020-04-15 19:03:36 +03:00
parent 7086dd0f76
commit 9d54895e33
5 changed files with 27 additions and 5 deletions

View file

@ -35,6 +35,7 @@ function createWindow () {
});
let param = {
show: false,
width: width,
height: height,
webPreferences: {
@ -49,6 +50,14 @@ function createWindow () {
win = new BrowserWindow(param);
win.once('ready-to-show', () => {
win.show()
});
win.on('closed', () => {
win = null;
});
if (process.env.ELECTRON_DEV_EXTENSIONS) {
BrowserWindow.addDevToolsExtension(
path.join(os.homedir(), '/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.5.0_0')
@ -67,7 +76,8 @@ function createWindow () {
});
ipcMain.on('appClose', () => {
app.quit();
console.log('appClose');
app.exit();
});
ipcMain.on('urlOpen', async (e, url) => {