fix: publish widget mentions (#1198)
parent
d24c1da35e
commit
bb2e3ab44f
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<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 />
|
<span i-ri-arrow-right-line ml--1 text-secondary-light /><slot />
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -133,9 +133,9 @@ defineExpose({
|
||||||
:class="[isSending ? 'pointer-events-none' : '', isOverDropZone ? '!border-primary' : '']"
|
:class="[isSending ? 'pointer-events-none' : '', isOverDropZone ? '!border-primary' : '']"
|
||||||
>
|
>
|
||||||
<ContentMentionGroup v-if="draft.mentions?.length && shouldExpanded">
|
<ContentMentionGroup v-if="draft.mentions?.length && shouldExpanded">
|
||||||
<div v-for="m of draft.mentions" :key="m" text-primary>
|
<button v-for="m, i of draft.mentions" :key="m" text-primary hover:color-red @click="draft.mentions?.splice(i, 1)">
|
||||||
@{{ m }}
|
{{ acctToShortHandle(m) }}
|
||||||
</div>
|
</button>
|
||||||
</ContentMentionGroup>
|
</ContentMentionGroup>
|
||||||
|
|
||||||
<div v-if="draft.params.sensitive">
|
<div v-if="draft.params.sensitive">
|
||||||
|
|
|
@ -7,10 +7,14 @@ export function getDisplayName(account: mastodon.v1.Account, options?: { rich?:
|
||||||
return displayName.replace(/:([\w-]+?):/g, '')
|
return displayName.replace(/:([\w-]+?):/g, '')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function acctToShortHandle(acct: string) {
|
||||||
|
return `@${acct.includes('@') ? acct.split('@')[0] : acct}`
|
||||||
|
}
|
||||||
|
|
||||||
export function getShortHandle({ acct }: mastodon.v1.Account) {
|
export function getShortHandle({ acct }: mastodon.v1.Account) {
|
||||||
if (!acct)
|
if (!acct)
|
||||||
return ''
|
return ''
|
||||||
return `@${acct.includes('@') ? acct.split('@')[0] : acct}`
|
return acctToShortHandle(acct)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getServerName(account: mastodon.v1.Account) {
|
export function getServerName(account: mastodon.v1.Account) {
|
||||||
|
|
Loading…
Reference in New Issue