refactor: make auto import more explicit

This commit is contained in:
Anthony Fu 2023-01-30 11:58:18 +01:00
parent fbdaf8bbef
commit 8d792d003d
13 changed files with 19 additions and 21 deletions

View file

@ -7,14 +7,14 @@ export function getDisplayName(account: mastodon.v1.Account, options?: { rich?:
return displayName.replace(/:([\w-]+?):/g, '')
}
export function acctToShortHandle(acct: string) {
export function accountToShortHandle(acct: string) {
return `@${acct.includes('@') ? acct.split('@')[0] : acct}`
}
export function getShortHandle({ acct }: mastodon.v1.Account) {
if (!acct)
return ''
return acctToShortHandle(acct)
return accountToShortHandle(acct)
}
export function getServerName(account: mastodon.v1.Account) {

View file

@ -47,7 +47,7 @@ export function mastoLogin(masto: ElkMasto, user: Pick<UserLogin, 'server' | 'to
setParams({
streamingApiUrl: newInstance.urls.streamingApi,
})
instances.value[server] = newInstance
instanceStorage.value[server] = newInstance
})
return instance