rever load.js changes
This commit is contained in:
parent
97d5cf6e60
commit
dbcba4ff18
2 changed files with 52 additions and 65 deletions
7
load.js
7
load.js
|
@ -13,7 +13,6 @@ let itemLists = new Map();
|
|||
* Load item set from local DB. Calls init() on success.
|
||||
*/
|
||||
async function load_local(init_func) {
|
||||
if (!itemMap) {
|
||||
let get_tx = db.transaction(['item_db', 'set_db'], 'readonly');
|
||||
let sets_store = get_tx.objectStore('set_db');
|
||||
let get_store = get_tx.objectStore('item_db');
|
||||
|
@ -47,14 +46,8 @@ async function load_local(init_func) {
|
|||
}
|
||||
await get_tx.complete;
|
||||
db.close();
|
||||
} else {
|
||||
console.log("Item and Set dbs already loaded!");
|
||||
}
|
||||
|
||||
if (itemMap) {
|
||||
init_func();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean bad item data. For now just assigns display name if it isn't already assigned.
|
||||
|
|
|
@ -21,7 +21,6 @@ let recipeIDMap;
|
|||
*/
|
||||
async function ing_load_local(init_func) {
|
||||
console.log("IngMap is: \n " + ingMap);
|
||||
if (!ingMap) {
|
||||
let get_tx = idb.transaction(['ing_db', 'recipe_db'], 'readonly');
|
||||
let ings_store = get_tx.objectStore('ing_db');
|
||||
let recipes_store = get_tx.objectStore('recipe_db');
|
||||
|
@ -44,13 +43,8 @@ async function ing_load_local(init_func) {
|
|||
}
|
||||
await get_tx.complete;
|
||||
idb.close();
|
||||
} else {
|
||||
console.log("Ingredient and Recipe dbs already loaded!");
|
||||
}
|
||||
if (ingMap) {
|
||||
init_func();
|
||||
}
|
||||
}
|
||||
|
||||
function clean_ing(ing) {
|
||||
if (ing.remapID === undefined) {
|
||||
|
|
Loading…
Reference in a new issue