mirror of
https://github.com/getbible/app.git
synced 2024-12-22 07:48:55 +00:00
Fixed delete method bug using cursor, fixes #2
This commit is contained in:
parent
1fbbc54fbd
commit
d1ffc57dc3
@ -42,18 +42,22 @@ export default {
|
||||
};
|
||||
|
||||
let store = trans.objectStore(delInfo.name);
|
||||
console.log("deleting "+ delInfo.keyPath+ " from "+delInfo.name);
|
||||
let request = store.delete([delInfo.keyPath]);
|
||||
request.onerror= err => reject(err)
|
||||
// request.onsuccess = e => console.log(e);
|
||||
|
||||
store.openCursor().onsuccess = e => {
|
||||
let cursor = e.target.result;
|
||||
if (cursor) {
|
||||
if(delInfo.keyPath == cursor.value['abbreviation']){
|
||||
let request =cursor.delete()
|
||||
request.onsuccess = e => console.log(e);}
|
||||
|
||||
cursor.continue();
|
||||
}
|
||||
};
|
||||
trans.onerror = e => {
|
||||
reject(e)
|
||||
}
|
||||
trans.onabort = e => {
|
||||
reject(e)
|
||||
}
|
||||
trans.commit();
|
||||
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user