From c4a88dd651432eacce295cc958f6e0909e1b4b8b Mon Sep 17 00:00:00 2001 From: lilia Date: Fri, 26 Feb 2016 12:25:32 -0800 Subject: [PATCH] Fix getUnread query Booleans are not valid keys in indexeddb. https://www.w3.org/TR/IndexedDB/#dfn-valid-key // FREEBIE --- js/background.js | 2 +- js/models/conversations.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/background.js b/js/background.js index f619271e..2e76b29e 100644 --- a/js/background.js +++ b/js/background.js @@ -176,7 +176,7 @@ received_at : now, conversationId : source, type : 'incoming', - unread : true + unread : 1 }); return message; diff --git a/js/models/conversations.js b/js/models/conversations.js index e3098aa8..75e59046 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -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);