From 09e071f6bf7c923f5be36aa48663d2d1476281f4 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 29 Nov 2022 04:44:50 +0800 Subject: [PATCH] fix: reuse existing relationship ref --- composables/masto.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/composables/masto.ts b/composables/masto.ts index 0c31788d..b5a78be7 100644 --- a/composables/masto.ts +++ b/composables/masto.ts @@ -105,9 +105,7 @@ export function useRelationship(account: Account): Ref } async function fetchRelationships() { - const requested = Array.from(requestedRelationships.entries()) - requestedRelationships.clear() - + const requested = Array.from(requestedRelationships.entries()).filter(([, r]) => !r.value) const relationships = await useMasto().accounts.fetchRelationships(requested.map(([id]) => id)) for (let i = 0; i < requested.length; i++) requested[i][1].value = relationships[i]