diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-08-22 16:37:33 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-08-22 16:37:33 +0200 |
commit | dbcd0118863ff3e7c5bee45041ccdb757eb2f366 (patch) | |
tree | dc08c8641d1f886b579360f3c63a919545ed23fb /resources/js/db.js | |
parent | c0354b250f84d578b609a7f25d71dee7fc24e9ca (diff) |
areas and town/shop setup
Diffstat (limited to 'resources/js/db.js')
-rw-r--r-- | resources/js/db.js | 5 |
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; } |