From 426cd9dad94842652b95086655821fc4c4da7292 Mon Sep 17 00:00:00 2001 From: Jonathan Simcoe Date: Thu, 23 Aug 2018 11:53:08 -0700 Subject: [PATCH] Adding a quick Dock badge fix. --- index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 1b6438b..fa081a8 100755 --- a/index.js +++ b/index.js @@ -29,10 +29,11 @@ if (isAlreadyRunning) { } function updateBadge(title) { - // ignore `Sindre messaged you` blinking - if (title.indexOf('Keyframes') === -1) { - return; - } + + mainWindow.webContents.executeJavaScript(` + var count = document.getElementsByClassName('unread')["0"].dataset.unreadCount; + document.title = "Keyframes (" + count + ")"; + `); let messageCount = (/\(([0-9]+)\)/).exec(title); messageCount = messageCount ? Number(messageCount[1]) : 0;