Fix NaN badge
lolNaNcat
This commit is contained in:
parent
8b9a168524
commit
196aa28873
1 changed files with 2 additions and 2 deletions
|
@ -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("");
|
||||
|
|
Loading…
Add table
Reference in a new issue