Fix NaN badge

lolNaNcat
This commit is contained in:
lilia 2015-03-25 13:09:10 -07:00
parent 8b9a168524
commit 196aa28873

View file

@ -31,9 +31,9 @@
inbox.on('change:active_at', inbox.sort);
inbox.on('change:unreadCount', function(model, count) {
var prev = model.previous('unreadCount');
var prev = model.previous('unreadCount') || 0;
if (count < prev) { // decreased
var newUnreadCount = textsecure.storage.get("unreadCount") - (prev - count);
var newUnreadCount = textsecure.storage.get("unreadCount", 0) - (prev - count);
if (newUnreadCount <= 0) {
newUnreadCount = 0;
extension.navigator.setBadgeText("");