Inline setUnreadCount

// FREEBIE
This commit is contained in:
lilia 2017-05-03 22:29:06 -07:00 committed by Scott Nonnenberg
parent e1282f9b3b
commit c4ccf7c8e3
No known key found for this signature in database
GPG key ID: A4931C09644C654B
2 changed files with 7 additions and 11 deletions

View file

@ -62,7 +62,13 @@
);
storage.put("unreadCount", newUnreadCount);
setUnreadCount(newUnreadCount);
if (newUnreadCount > 0) {
window.setBadgeCount(newUnreadCount);
window.document.title = "Signal (" + newUnreadCount + ")";
} else {
window.setBadgeCount(0);
window.document.title = "Signal";
}
if (newUnreadCount === 0) {
window.clearAttention();
}

View file

@ -25,14 +25,4 @@
};
var inboxWindowId = 'inbox';
window.setUnreadCount = function(count) {
if (count > 0) {
window.setBadgeCount(count);
window.document.title = "Signal (" + count + ")";
} else {
window.setBadgeCount(0);
window.document.title = "Signal";
}
};
})();