fix: gracefully handle contributor fetch faliure
This commit is contained in:
parent
c73572e195
commit
2c9ac1ecb1
1 changed files with 26 additions and 22 deletions
|
|
@ -127,7 +127,9 @@ async function loadDownloadsModule() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchcontributors() {
|
async function fetchcontributors() {
|
||||||
|
try {
|
||||||
const response = await fetch('https://api.samidy.com/api/contributors');
|
const response = await fetch('https://api.samidy.com/api/contributors');
|
||||||
|
if (!response.ok) return;
|
||||||
const data1 = await response.json();
|
const data1 = await response.json();
|
||||||
|
|
||||||
const data = data1.filter(
|
const data = data1.filter(
|
||||||
|
|
@ -141,6 +143,7 @@ async function fetchcontributors() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const con = document.querySelector('.about-contributors');
|
const con = document.querySelector('.about-contributors');
|
||||||
|
if (!con) return;
|
||||||
|
|
||||||
data.forEach((user) => {
|
data.forEach((user) => {
|
||||||
const userDIV = document.createElement('div');
|
const userDIV = document.createElement('div');
|
||||||
|
|
@ -153,6 +156,7 @@ async function fetchcontributors() {
|
||||||
`;
|
`;
|
||||||
con.appendChild(userDIV);
|
con.appendChild(userDIV);
|
||||||
});
|
});
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadMetadataModule() {
|
async function loadMetadataModule() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue