Merge (un)encrypted storage layers

This commit is contained in:
Matt Corallo 2015-03-24 16:20:36 -07:00 committed by lilia
parent 454b4726bd
commit 00cb420d37
12 changed files with 102 additions and 143 deletions

View file

@ -33,14 +33,14 @@
inbox.on('change:unreadCount', function(model, count) {
var prev = model.previous('unreadCount');
if (count < prev) { // decreased
var newUnreadCount = textsecure.storage.getUnencrypted("unreadCount") - (prev - count);
var newUnreadCount = textsecure.storage.get("unreadCount") - (prev - count);
if (newUnreadCount <= 0) {
newUnreadCount = 0;
extension.navigator.setBadgeText("");
} else {
extension.navigator.setBadgeText(newUnreadCount);
}
textsecure.storage.putUnencrypted("unreadCount", newUnreadCount);
textsecure.storage.put("unreadCount", newUnreadCount);
}
});