Merge pull request #290 from KiranNiranjan/ELECTRON-262

Electron-262 (Fixes Badge Count Issue)
This commit is contained in:
Vikas Shashidhar 2018-01-10 20:57:33 +05:30 committed by GitHub
commit 665f35b08e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,8 +367,17 @@ function createAPI() {
});
}
// reset the badge count whenever an user refreshes the electron client
function resetBadgeCount() {
local.ipcRenderer.send(apiName, {
cmd: apiCmds.setBadgeCount,
count: 0
});
}
window.addEventListener('offline', updateOnlineStatus, false);
window.addEventListener('online', updateOnlineStatus, false);
window.addEventListener('beforeunload', resetBadgeCount, false);
updateOnlineStatus();
}