Always call init func

This commit is contained in:
b 2021-04-02 15:09:29 -07:00
parent 64550a81fe
commit e5cde9ff8e
3 changed files with 8 additions and 1 deletions

View file

@ -119,6 +119,7 @@ async function load(init_func) {
function load_init(init_func) {
if (db) {
console.log("Item db already loaded, skipping load sequence");
init_func();
return;
}
let request = window.indexedDB.open('item_db', DB_VERSION);

View file

@ -105,6 +105,7 @@ async function load_ings(init_func) {
function load_ing_init(init_func) {
if (idb) {
console.log("Ingredient db already loaded, skipping load sequence");
init_func();
return;
}
let request = window.indexedDB.open("ing_db", ING_DB_VERSION)

View file

@ -108,6 +108,11 @@ function load_map_init(init_func) {
// window.indexedDB.deleteDatabase("map_db", MAP_DB_VERSION);
// window.indexedDB.deleteDatabase("maploc_db", MAP_DB_VERSION);
if (mdb) {
console.log("Map db already loaded, skipping load sequence");
init_func();
return;
}
let request = window.indexedDB.open("map_db", MAP_DB_VERSION)
request.onerror = function() {