v1.5.25 - smarter generation

This commit is contained in:
Azgaar 2021-02-14 15:11:42 +03:00
parent 2f3f5d05fb
commit 66bd7b7f6f
9 changed files with 38 additions and 28 deletions

View file

@ -967,8 +967,9 @@
return fetchedCharges.join("");
}
const url = PRODUCTION ? "https://azgaar.github.io/Armoria/charges/" : "http://armoria.herokuapp.com/charges/";
async function fetchCharge(charge, id) {
const fetched = fetch("https://azgaar.github.io/Armoria/charges/" + charge + ".svg").then(res => {
const fetched = fetch(url + charge + ".svg").then(res => {
if (res.ok) return res.text();
else throw new Error("Cannot fetch charge");
}).then(text => {