mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 23:57:50 +01:00
does this work idk qwq
This commit is contained in:
parent
d63cbc3690
commit
44f05a83af
1 changed files with 6 additions and 10 deletions
|
@ -46,18 +46,14 @@ async _getEngagementData() {
|
||||||
|
|
||||||
const { fetch } = await import("undici");
|
const { fetch } = await import("undici");
|
||||||
|
|
||||||
|
var engagementP = await fetch(apiUrl).then((res) => res.json());
|
||||||
try {
|
|
||||||
const engagement = await fetch(apiUrl).then((res) => res.json());
|
if(!engagementP.dislikes) {
|
||||||
return engagement;
|
var engagement = await fetch(fallbackUrl).then((res) => res.json());
|
||||||
} catch {
|
|
||||||
try {
|
|
||||||
const engagement = await fetch(fallbackUrl).then((res) => res.json());
|
|
||||||
return engagement;
|
return engagement;
|
||||||
} catch {
|
} else {
|
||||||
return null;
|
return engagementP;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue