From 116447c35f6ae5f5c95d5116be5ea6964d32e927 Mon Sep 17 00:00:00 2001 From: Martin Alcubierre Arenillas Date: Thu, 24 Sep 2015 10:27:13 +0200 Subject: [PATCH] Update ng-pouchdb-collection.js Removed index was undefined and updateindex did not work properly. Pass explicity the removed index to the update --- www/js/ng-pouchdb-collection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/js/ng-pouchdb-collection.js b/www/js/ng-pouchdb-collection.js index fc9577d..a0622da 100644 --- a/www/js/ng-pouchdb-collection.js +++ b/www/js/ng-pouchdb-collection.js @@ -43,6 +43,7 @@ angular.module('pouchdb') indexes[id] = undefined; console.log('removed: ', id); + return index; } function updateChild (index, item) { @@ -80,8 +81,7 @@ angular.module('pouchdb') } }); } else { //DELETE - removeChild(change.id); - updateIndexes(indexes[change.id]); + updateIndexes(removeChild(change.id)); } }});