10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-08-24 21:21:52 +02:00

Fix null instead of undefined in indexDB (#4)

* Fix broken link

* Fix bug in indexDB

* Fix sourceFile  for each geometry

Co-authored-by: Mickaël Véril <mveril@irsamc.ups-tlse.fr>
This commit is contained in:
mveril 2020-12-07 11:07:16 +01:00 committed by GitHub
parent 721d95b4d0
commit c0cc26d1f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -14,7 +14,9 @@ class Geometry {
break
}
var xyz = this.loadXYZString(str);
xyz.sourceFile = new websiteFile(file)
for (var geom of xyz){
geom.sourceFile = new websiteFile(file)
}
return xyz
}
static loadXYZString(text) {

View File

@ -8,8 +8,8 @@ class indexDB {
var site_url = "/"+window.location.pathname.split('/')[1];
const text = await getTextFromFileUrlAsync(site_url+"/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));
db.sets = ((myYaml.sets === undefined) ? new Map() : new Map(Object.entries(myYaml.sets)));
db.others = ((myYaml.others === undefined) ? [] : Array.from(myYaml.others));
window.indexDB=db
return db
}