Fix followers list failing if familiar followers fail

This commit is contained in:
Lim Chee Aun 2024-04-10 14:19:35 +08:00
parent 4e5940900e
commit 5c9f6bae3c

View file

@ -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(