From 7ddf6aaa654b946fd7dbce39403c9507547b3e3e Mon Sep 17 00:00:00 2001 From: Johnny Bui Date: Sun, 15 Apr 2018 11:12:46 +0700 Subject: [PATCH] (fix) error when launching on macOS with disabled show unread badge --- app/main/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main/index.js b/app/main/index.js index 4fd0599..06a93c2 100644 --- a/app/main/index.js +++ b/app/main/index.js @@ -156,8 +156,8 @@ app.on('before-quit', () => { ipcMain.on('update-unreads-count', (e, unreadCount) => { if (isDarwin || isLinux) { - app.setBadgeCount(config.get('showUnreadBadge') ? unreadCount : undefined); - if (isDarwin && config.get('bounceDockIcon') && prevUnreadCount !== unreadCount) { + const isUpdated = config.get('showUnreadBadge') ? app.setBadgeCount(unreadCount) : false; + if (isDarwin && config.get('bounceDockIcon') && prevUnreadCount !== unreadCount && isUpdated) { app.dock.bounce('informational'); prevUnreadCount = unreadCount; }