Merge pull request #294 from lbryio/teardown-focused-listeners
Teardown old window event listeners and don't blow up when window isn't focused
This commit is contained in:
commit
6aad233f66
1 changed files with 4 additions and 1 deletions
|
@ -75,7 +75,10 @@ document.addEventListener("click", event => {
|
||||||
|
|
||||||
const application = remote.app;
|
const application = remote.app;
|
||||||
const dock = application.dock;
|
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
|
// Clear the badge when the window is focused
|
||||||
win.on("focus", () => {
|
win.on("focus", () => {
|
||||||
|
|
Loading…
Reference in a new issue