From a3af9abdf9dfc89b801a36ea0d2fb9dc01328492 Mon Sep 17 00:00:00 2001 From: kiranniranjan Date: Wed, 10 Jan 2018 16:48:43 +0530 Subject: [PATCH] Electron-262 Implemented a method to reset badge count on window navigation/reload --- js/preload/preloadMain.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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