mirror of
https://github.com/Queer-Lexikon/regenbogenkarte
synced 2025-02-16 12:58:28 +00:00
Make loadJSON more robust
This commit is contained in:
parent
11613e045a
commit
40b614b54e
1 changed files with 9 additions and 2 deletions
11
ts/data.ts
11
ts/data.ts
|
@ -13,6 +13,13 @@ export const loadJSON = async () => {
|
|||
return data;
|
||||
}
|
||||
|
||||
const json = await resp.json();
|
||||
return json;
|
||||
return resp
|
||||
.json()
|
||||
.then((json) => {
|
||||
return json;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.warn("Loading JSON from returnd content failed, using compiled JSON as fallback.");
|
||||
return data;
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue