From 18e9ded296fe4a68d250fe223075a62a0c280daf Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 17 Feb 2016 16:09:06 -0800 Subject: [PATCH] Fix storage.put Adding an existing id to a collection is a no-op. To update an existing item, we must pass {merge: true} as an option. // FREEBIE --- js/storage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/storage.js b/js/storage.js index 30a424c9..9c0b8b5d 100644 --- a/js/storage.js +++ b/js/storage.js @@ -24,7 +24,7 @@ put: function(key, value) { if (value === undefined) throw new Error("Tried to store undefined"); - var item = items.add({id: key, value: value}); + var item = items.add({id: key, value: value}, {merge: true}); item.save(); },