From 7d987cd49d45af36053f37afa702553544a4acb3 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Fri, 5 May 2023 21:05:09 +0200 Subject: [PATCH] feat: show followers from account's instance --- pages/[[server]]/@[account]/index/following.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pages/[[server]]/@[account]/index/following.vue b/pages/[[server]]/@[account]/index/following.vue index 173502b9..c4ae64d5 100644 --- a/pages/[[server]]/@[account]/index/following.vue +++ b/pages/[[server]]/@[account]/index/following.vue @@ -14,6 +14,20 @@ if (account) { useHydratedHead({ title: () => `${t('account.following')} | ${getDisplayName(account)} (@${account.acct})`, }) + + const currentUserInstance = currentUser.value?.account.url.split('/@')[0] + const accountInstance = account.url.split('/@')[0] + + if (currentUserInstance !== accountInstance) { + const otherMasto = createMasto() + otherMasto.setParams({ url: accountInstance }) + + const otherAccount = await otherMasto.client.value.v1.accounts.lookup({ acct: account.acct }) + + const otherPaginator = otherMasto.client.value.v1.accounts.listFollowing(otherAccount.id, {}) + + console.log((await otherPaginator.next()).value) + } }