mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-18 13:23:28 -05: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 => {
|
||||
cache.set(id, { badges: body, expires: Date.now() + EXPIRES });
|
||||
return body;
|
||||
});
|
||||
})
|
||||
.catch(() => null);
|
||||
} else if (cachedValue) {
|
||||
return cachedValue.badges;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,10 @@ export default definePlugin({
|
|||
return data.avatars[user.id] ?? original(user, animated, size);
|
||||
},
|
||||
async start() {
|
||||
const res = await fetch(settings.store.urlForDB);
|
||||
if (res.ok) this.data = data = await res.json();
|
||||
const res = await fetch(settings.store.urlForDB)
|
||||
.then(async res => {
|
||||
if (res.ok) this.data = data = await res.json();
|
||||
})
|
||||
.catch(() => null);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue