diff --git a/load.js b/load.js index 266a436..8cddd6b 100644 --- a/load.js +++ b/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); diff --git a/load_ing.js b/load_ing.js index 83cc13a..e8a1b69 100644 --- a/load_ing.js +++ b/load_ing.js @@ -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) diff --git a/load_map.js b/load_map.js index 3ab501f..b69c69c 100644 --- a/load_map.js +++ b/load_map.js @@ -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}); } -} \ No newline at end of file +}