Electron-262

Implemented a method to reset badge count on window navigation/reload
This commit is contained in:
kiranniranjan 2018-01-10 16:48:43 +05:30
parent d49cffb185
commit a3af9abdf9

View File

@ -367,8 +367,17 @@ function createAPI() {
});
}
// reset the badge count when ever user refresh
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();
}