From ef5bfb79f0acfe204c7bb68a5c0c935efbbd01c9 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 11 May 2023 20:12:05 -0500 Subject: [PATCH] buildInlineRecipients: delete extra space when there are no inline mentions --- src/transmute.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/transmute.ts b/src/transmute.ts index 51f8995..b024913 100644 --- a/src/transmute.ts +++ b/src/transmute.ts @@ -148,6 +148,8 @@ async function toStatus(event: Event<1>) { type Mention = Awaited>; function buildInlineRecipients(mentions: Mention[]): string { + if (!mentions.length) return ''; + const elements = mentions.reduce((acc, { url, username }) => { const name = nip21.BECH32_REGEX.test(username) ? username.substring(0, 8) : username; acc.push(`@${name}`);