fix x-res topic load bug

This commit is contained in:
Azareal 2020-03-23 11:42:42 +10:00
parent 0635627950
commit cdaeb477a2

View File

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