Skip to content

Commit

Permalink
refactor: external parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
artegoser committed Jan 23, 2024
1 parent fc6b758 commit ffce6ae
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ffce6ae

Please sign in to comment.