fix: v1 instance api

This commit is contained in:
三咲智子 2023-01-08 17:31:47 +08:00
parent c5573cb10b
commit c7f4b33bf1
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
2 changed files with 4 additions and 4 deletions

View file

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