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() {
|
||||
try {
|
||||
const response = await fetch('https://api.samidy.com/api/contributors');
|
||||
if (!response.ok) return;
|
||||
const data1 = await response.json();
|
||||
|
||||
const data = data1.filter(
|
||||
|
|
@ -141,6 +143,7 @@ async function fetchcontributors() {
|
|||
}
|
||||
|
||||
const con = document.querySelector('.about-contributors');
|
||||
if (!con) return;
|
||||
|
||||
data.forEach((user) => {
|
||||
const userDIV = document.createElement('div');
|
||||
|
|
@ -153,6 +156,7 @@ async function fetchcontributors() {
|
|||
`;
|
||||
con.appendChild(userDIV);
|
||||
});
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
async function loadMetadataModule() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue