Fix followers list failing if familiar followers fail

pull/493/head
Lim Chee Aun 2024-04-10 14:19:35 +08:00
rodzic 4e5940900e
commit 5c9f6bae3c
1 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -254,12 +254,13 @@ function AccountInfo({
// On first load, fetch familiar followers, merge to top of results' `value` // On first load, fetch familiar followers, merge to top of results' `value`
// Remove dups on every fetch // Remove dups on every fetch
if (firstLoad) { if (firstLoad) {
const familiarFollowers = await masto.v1.accounts.familiarFollowers.fetch( let familiarFollowers = [];
{ try {
familiarFollowers = await masto.v1.accounts.familiarFollowers.fetch({
id: [id], id: [id],
}, });
); } catch (e) {}
familiarFollowersCache.current = familiarFollowers[0].accounts; familiarFollowersCache.current = familiarFollowers?.[0]?.accounts || [];
newValue = [ newValue = [
...familiarFollowersCache.current, ...familiarFollowersCache.current,
...value.filter( ...value.filter(