diff --git a/ui/js/main.js b/ui/js/main.js index 94df53b32..9bef9aae1 100644 --- a/ui/js/main.js +++ b/ui/js/main.js @@ -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", () => {