diff --git a/js/preload/preloadMain.js b/js/preload/preloadMain.js index 165dd10b..35b5c2e8 100644 --- a/js/preload/preloadMain.js +++ b/js/preload/preloadMain.js @@ -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(); } \ No newline at end of file