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)); } }});