Fix getUnread query

Booleans are not valid keys in indexeddb.
https://www.w3.org/TR/IndexedDB/#dfn-valid-key

// FREEBIE
This commit is contained in:
lilia 2016-02-26 12:25:32 -08:00
parent aac9f3ec4c
commit c4a88dd651
2 changed files with 4 additions and 4 deletions

View file

@ -176,7 +176,7 @@
received_at : now, received_at : now,
conversationId : source, conversationId : source,
type : 'incoming', type : 'incoming',
unread : true unread : 1
}); });
return message; return message;

View file

@ -56,9 +56,9 @@
return unreadMessages.fetch({ return unreadMessages.fetch({
index: { index: {
// 'unread' index // 'unread' index
name: 'unread', name : 'unread',
lower: [conversationId, true], lower : [conversationId],
upper: [conversationId, true] upper : [conversationId, Number.MAX_VALUE],
} }
}).always(function() { }).always(function() {
resolve(unreadMessages); resolve(unreadMessages);