refactor: external parsing

This commit is contained in:
Artemy 2024-01-23 20:41:05 +03:00
parent fc6b758d4c
commit ffce6aeb51

View file

@ -42,20 +42,16 @@ window.onload = async () => {
).json()
)[mapId];
if (mIdData.external) {
mIdData = await (await fetch(mIdData.external)).json();
}
if (!mIdData) {
alert(`Map ${mapId} not found`);
}
let mData = {};
if (params.external) {
const data = await (await fetch(params.external)).json();
mData.external = params.external || mIdData.external;
mData.geoURL = data.geoURL;
if (mData.external) {
mData = await (await fetch(mData.external)).json();
}
mData.geoURL = params.geoURL || mIdData.geoURL;