fix x-res topic load bug

This commit is contained in:
Azareal 2020-03-23 11:42:42 +10:00
parent 0635627950
commit cdaeb477a2
1 changed files with 12 additions and 10 deletions

View File

@ -858,17 +858,19 @@ function mainInit(){
.then(resp => {
if(!resp.ok) throw(href+" failed to load");
let xRes = resp.headers.get("x-res")
if(xRes!=null) {
for(let res of xRes.split(",")) {
let pro;
if(stripQ(getExt(res))=="css") pro = asyncGetSheet("/s/"+res)
else pro = asyncGetScript("/s/"+res)
pro.then(() => console.log("Loaded "+res))
.catch(e => {
console.log("Unable to get res '"+res+"'");
console.log("Unable to get '"+res+"'");
console.log("e",e);
console.trace();
});
}
}
return resp.text();
}).then(data => {
document.querySelector("#back").outerHTML = data;