diff --git a/components/account/AccountCard.vue b/components/account/AccountCard.vue index 199d587a..5fa3c9c6 100644 --- a/components/account/AccountCard.vue +++ b/components/account/AccountCard.vue @@ -1,9 +1,26 @@ diff --git a/components/account/AccountPaginator.client.vue b/components/account/AccountPaginator.client.vue index 0e75d1d5..14389294 100644 --- a/components/account/AccountPaginator.client.vue +++ b/components/account/AccountPaginator.client.vue @@ -4,16 +4,30 @@ import type { Account, Paginator } from 'masto' const { paginator } = defineProps<{ paginator: Paginator }>() + +const masto = await useMasto() + +const metadataMap = $ref<{ [key: string]: { following?: boolean } }>({}) +async function onNewItems(items: Account[]) { + for (const item of items) + metadataMap[item.id] = { following: undefined } + + const relationships = await masto.accounts.fetchRelationships(items.map(item => item.id)) + for (const rel of relationships) + metadataMap[rel.id].following = rel.following +}