forked from Mirrors/elk
fix: publish widget mentions (#1198)
This commit is contained in:
parent
d24c1da35e
commit
bb2e3ab44f
3 changed files with 9 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<p flex="~ gap-1" items-center text-sm class="zen-none">
|
||||
<p flex="~ gap-1 wrap" items-center text-sm class="zen-none">
|
||||
<span i-ri-arrow-right-line ml--1 text-secondary-light /><slot />
|
||||
</p>
|
||||
</template>
|
||||
|
|
|
@ -133,9 +133,9 @@ defineExpose({
|
|||
:class="[isSending ? 'pointer-events-none' : '', isOverDropZone ? '!border-primary' : '']"
|
||||
>
|
||||
<ContentMentionGroup v-if="draft.mentions?.length && shouldExpanded">
|
||||
<div v-for="m of draft.mentions" :key="m" text-primary>
|
||||
@{{ m }}
|
||||
</div>
|
||||
<button v-for="m, i of draft.mentions" :key="m" text-primary hover:color-red @click="draft.mentions?.splice(i, 1)">
|
||||
{{ acctToShortHandle(m) }}
|
||||
</button>
|
||||
</ContentMentionGroup>
|
||||
|
||||
<div v-if="draft.params.sensitive">
|
||||
|
|
|
@ -7,10 +7,14 @@ export function getDisplayName(account: mastodon.v1.Account, options?: { rich?:
|
|||
return displayName.replace(/:([\w-]+?):/g, '')
|
||||
}
|
||||
|
||||
export function acctToShortHandle(acct: string) {
|
||||
return `@${acct.includes('@') ? acct.split('@')[0] : acct}`
|
||||
}
|
||||
|
||||
export function getShortHandle({ acct }: mastodon.v1.Account) {
|
||||
if (!acct)
|
||||
return ''
|
||||
return `@${acct.includes('@') ? acct.split('@')[0] : acct}`
|
||||
return acctToShortHandle(acct)
|
||||
}
|
||||
|
||||
export function getServerName(account: mastodon.v1.Account) {
|
||||
|
|
Loading…
Reference in a new issue