Better handle deleting bookmarks

This commit is contained in:
Neil Brommer 2017-12-30 19:44:49 -08:00
parent a654539a55
commit e2ead1d33f

View file

@ -153,17 +153,16 @@ function deleteGroup(e) {
groupsStore.getAll().onsuccess = function (getEvt) { groupsStore.getAll().onsuccess = function (getEvt) {
var groups = getEvt.target.result; var groups = getEvt.target.result;
var lastIndex = -1;
for (let item of groups) { for (let item of groups) {
if (item.groupIndex > groupIndex) { if (item.groupIndex > groupIndex) {
lastIndex = item.groupIndex;
item.groupIndex--; item.groupIndex--;
groupsStore.put(item); groupsStore.put(item);
} }
} }
groupsStore.delete(lastIndex);
loadBookmarks(); loadBookmarks();
groupsStore.delete(groups.length - 1);
db.close();
} }
} }