From c7f4b33bf120f945b1595807476ca79932a44c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Sun, 8 Jan 2023 17:31:47 +0800 Subject: [PATCH] fix: v1 instance api --- composables/cache.ts | 4 ++-- composables/masto/account.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composables/cache.ts b/composables/cache.ts index b453c291..d61d2da4 100644 --- a/composables/cache.ts +++ b/composables/cache.ts @@ -41,7 +41,7 @@ export function fetchAccountById(id?: string | null): Promise { if (r.acct && !r.acct.includes('@') && domain) @@ -60,7 +60,7 @@ export async function fetchAccountByHandle(acct: string): Promise { if (r.acct && !r.acct.includes('@') && domain) diff --git a/composables/masto/account.ts b/composables/masto/account.ts index 91ca7911..8b47ac69 100644 --- a/composables/masto/account.ts +++ b/composables/masto/account.ts @@ -17,7 +17,7 @@ export function getServerName(account: mastodon.v1.Account) { if (account.acct?.includes('@')) return account.acct.split('@')[1] // We should only lack the server name if we're on the same server as the account - return currentInstance.value?.domain || '' + return currentInstance.value?.uri || '' } export function getFullHandle(account: mastodon.v1.Account) { @@ -38,7 +38,7 @@ export function toShortHandle(fullHandle: string) { export function extractAccountHandle(account: mastodon.v1.Account) { let handle = getFullHandle(account).slice(1) - const uri = currentInstance.value?.domain ?? currentServer.value + const uri = currentInstance.value?.uri ?? currentServer.value if (currentInstance.value && handle.endsWith(`@${uri}`)) handle = handle.slice(0, -uri.length - 1)