fix: account server in GoToSocial
This commit is contained in:
parent
ba5b89d5b8
commit
5247b36b6d
4 changed files with 14 additions and 6 deletions
|
@ -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?.uri || ''
|
||||
return currentInstance.value ? getInstanceDomain(currentInstance.value) : ''
|
||||
}
|
||||
|
||||
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?.uri ?? currentServer.value
|
||||
const uri = currentInstance.value ? getInstanceDomain(currentInstance.value) : currentServer.value
|
||||
if (currentInstance.value && handle.endsWith(`@${uri}`))
|
||||
handle = handle.slice(0, -uri.length - 1)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue