From e2ead1d33f3f2808226751db0ca83d7d9d24ddd7 Mon Sep 17 00:00:00 2001 From: Neil Brommer Date: Sat, 30 Dec 2017 19:44:49 -0800 Subject: [PATCH] Better handle deleting bookmarks --- js/editBookmarks.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/editBookmarks.js b/js/editBookmarks.js index 0b52af9..da0ba58 100644 --- a/js/editBookmarks.js +++ b/js/editBookmarks.js @@ -153,17 +153,16 @@ function deleteGroup(e) { groupsStore.getAll().onsuccess = function (getEvt) { var groups = getEvt.target.result; - var lastIndex = -1; for (let item of groups) { if (item.groupIndex > groupIndex) { - lastIndex = item.groupIndex; item.groupIndex--; groupsStore.put(item); } } - groupsStore.delete(lastIndex); loadBookmarks(); + groupsStore.delete(groups.length - 1); + db.close(); } }