Teardown old window event listeners and don't blow up when window isn't focused #294

Merged
6ea86b96 merged 1 commit from teardown-focused-listeners into master 2017-06-27 18:55:24 +02:00

View file

@ -75,7 +75,10 @@ document.addEventListener("click", event => {
const application = remote.app;
const dock = application.dock;
const win = remote.BrowserWindow.getFocusedWindow();
const win = remote.getCurrentWindow();
// Tear down previous event listeners when reload
win.removeAllListeners();
// Clear the badge when the window is focused
win.on("focus", () => {