Skip to content

Commit

Permalink
Adding a quick Dock badge fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdsimcoe committed Aug 23, 2018
1 parent 406b61e commit 426cd9d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 426cd9d

Please sign in to comment.