summaryrefslogtreecommitdiff
path: root/resources/js/db.js
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-08-22 16:37:33 +0200
committerDaniel Weipert <code@drogueronin.de>2023-08-22 16:37:33 +0200
commitdbcd0118863ff3e7c5bee45041ccdb757eb2f366 (patch)
treedc08c8641d1f886b579360f3c63a919545ed23fb /resources/js/db.js
parentc0354b250f84d578b609a7f25d71dee7fc24e9ca (diff)
areas and town/shop setup
Diffstat (limited to 'resources/js/db.js')
-rw-r--r--resources/js/db.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/resources/js/db.js b/resources/js/db.js
index ede65aa..f5cff6c 100644
--- a/resources/js/db.js
+++ b/resources/js/db.js
@@ -165,12 +165,15 @@ async function fetchTranslation (locale) {
* @returns {Promise<Area>}
*/
async function fetchArea (slug) {
+ if (Memory.state.areaProgress[slug]) {
+ return Memory.state.areaProgress[slug];
+ }
+
if (! DB.areas[slug]) {
DB.areas[slug] = await fetch(`/db/_generated/areas/${slug}.json`).then((response) => response.json());
}
const area = new Area(slug);
-
return area;
}