diff --git a/content/dataset.html b/content/dataset.html
index 08b978cf..1a813649 100644
--- a/content/dataset.html
+++ b/content/dataset.html
@@ -126,7 +126,7 @@ draft: false
window.defaultDats = window.defaultDats.concat(sub)
}
- window.indexDB = await indexDB.loadAsync()
+ await indexDB.loadAsync()
window.defaultDats = window.defaultDats.sort((datfA, datfB) => {
const exSetA = datfA.set
const exSetB = datfB.set
diff --git a/static/js/indexDB.js b/static/js/indexDB.js
index e736599b..f5d3bb88 100644
--- a/static/js/indexDB.js
+++ b/static/js/indexDB.js
@@ -1,11 +1,15 @@
class indexDB {
static async loadAsync() {
+ if (window.indexDB) {
+ return window.indexDB
+ }
var db = new indexDB
const maxAge= (DebugMode.Enabled,0,600)
const text = await getTextFromFileUrlAsync("/data/index.yaml",{"Cache-Control":`max-age=${maxAge}`})
const myYaml = jsyaml.load(text);
db.sets = ((myYaml.sets === null) ? new Map() : new Map(Object.entries(myYaml.sets)));
db.others = ((myYaml.others === null) ? [] : Array.from(myYaml.others));
+ window.indexDB=db
return db
}
}
\ No newline at end of file