Better handle deleting bookmarks
This commit is contained in:
parent
a654539a55
commit
e2ead1d33f
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue