From bced99e14b4a5f00bc3685d6669dca21c51c2fa2 Mon Sep 17 00:00:00 2001 From: patak Date: Sat, 26 Nov 2022 17:37:15 +0100 Subject: [PATCH] fix: getShortHandle --- composables/masto.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/composables/masto.ts b/composables/masto.ts index 55f991b5..295aaa16 100644 --- a/composables/masto.ts +++ b/composables/masto.ts @@ -47,8 +47,9 @@ export function getDisplayName(account?: Account, options?: { rich?: boolean }) return displayName.replace(/:([\w-]+?):/g, '') } -export function getShortHandle(account: Account) { - return `@${account.acct}` +export function getShortHandle({ acct }: Account) { + + return `@${acct.includes('@') ? acct.split('@')[0] : acct}` } export function getFullHandle(account: Account) {