mirror of
https://github.com/Equicord/Equicord.git
synced 2025-03-14 14:10:26 -04:00
catch errors on userpfp & globalbadges
This commit is contained in:
parent
94606a3a5d
commit
0da23d2810
2 changed files with 7 additions and 3 deletions
|
@ -52,7 +52,8 @@ const fetchBadges = (id: string): BadgeCache["badges"] | undefined => {
|
||||||
.then(body => {
|
.then(body => {
|
||||||
cache.set(id, { badges: body, expires: Date.now() + EXPIRES });
|
cache.set(id, { badges: body, expires: Date.now() + EXPIRES });
|
||||||
return body;
|
return body;
|
||||||
});
|
})
|
||||||
|
.catch(() => null);
|
||||||
} else if (cachedValue) {
|
} else if (cachedValue) {
|
||||||
return cachedValue.badges;
|
return cachedValue.badges;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,10 @@ export default definePlugin({
|
||||||
return data.avatars[user.id] ?? original(user, animated, size);
|
return data.avatars[user.id] ?? original(user, animated, size);
|
||||||
},
|
},
|
||||||
async start() {
|
async start() {
|
||||||
const res = await fetch(settings.store.urlForDB);
|
const res = await fetch(settings.store.urlForDB)
|
||||||
if (res.ok) this.data = data = await res.json();
|
.then(async res => {
|
||||||
|
if (res.ok) this.data = data = await res.json();
|
||||||
|
})
|
||||||
|
.catch(() => null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue