Fix NaN badge
lolNaNcat
This commit is contained in:
@@ -31,9 +31,9 @@
|
|||||||
|
|
||||||
inbox.on('change:active_at', inbox.sort);
|
inbox.on('change:active_at', inbox.sort);
|
||||||
inbox.on('change:unreadCount', function(model, count) {
|
inbox.on('change:unreadCount', function(model, count) {
|
||||||
var prev = model.previous('unreadCount');
|
var prev = model.previous('unreadCount') || 0;
|
||||||
if (count < prev) { // decreased
|
if (count < prev) { // decreased
|
||||||
var newUnreadCount = textsecure.storage.get("unreadCount") - (prev - count);
|
var newUnreadCount = textsecure.storage.get("unreadCount", 0) - (prev - count);
|
||||||
if (newUnreadCount <= 0) {
|
if (newUnreadCount <= 0) {
|
||||||
newUnreadCount = 0;
|
newUnreadCount = 0;
|
||||||
extension.navigator.setBadgeText("");
|
extension.navigator.setBadgeText("");
|
||||||
|
Reference in New Issue
Block a user