Always call init func
This commit is contained in:
parent
64550a81fe
commit
e5cde9ff8e
3 changed files with 8 additions and 1 deletions
1
load.js
1
load.js
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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() {
|
||||
|
@ -163,4 +168,4 @@ function init_map_maps() {
|
|||
resources.set(data.territory,{"resources":data.resources,"storage":data.storage,"emeralds":data.emeralds,"doubleemeralds":data.doubleemeralds,"doubleresource":data.doubleresource});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue