Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Fix process not exiting in certain circumstances (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgierer12 authored Mar 21, 2019
1 parent 80ffbee commit 2cc74de
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ const showWindow = () => {
window && window.show && window.show();
};

const exitWindow = () => {
window = null;
};

const createWindow = () => {
const windowState = getWindowState({
defaultWidth: 1200,
Expand Down Expand Up @@ -52,11 +48,13 @@ const createWindow = () => {
shell.openExternal(url);
});

window.on(`closed`, exitWindow);
process.on(`beforeExit`, exitWindow);
window.on(`closed`, () => {
window = null;
});
};

app.on(`ready`, createWindow);
app.on(`window-all-closed`, app.quit);

ipcMain.once(IPC_EVENTS.PLAYER_READY, () => require(`./mpris`).init(window));

Expand Down

0 comments on commit 2cc74de

Please sign in to comment.