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,
conversationId : source,
type : 'incoming',
unread : true
unread : 1
});
return message;

View file

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