Fix one-char space inserted when replying to own posts

pull/9/head
Lim Chee Aun 2022-12-17 17:25:04 +08:00
rodzic d0579a57d6
commit 1c18184ef4
1 zmienionych plików z 9 dodań i 5 usunięć

Wyświetl plik

@ -93,11 +93,15 @@ function Compose({
replyToStatus.account.acct,
...replyToStatus.mentions.map((m) => m.acct),
]);
textareaRef.current.value = `${[...mentions]
.filter((m) => m !== currentAccountInfo.acct) // Excluding self
.map((m) => `@${m}`)
.join(' ')} `;
textareaRef.current.dispatchEvent(new Event('input'));
const allMentions = [...mentions].filter(
(m) => m !== currentAccountInfo.acct,
);
if (allMentions.length > 0) {
textareaRef.current.value = `${allMentions
.map((m) => `@${m}`)
.join(' ')} `;
textareaRef.current.dispatchEvent(new Event('input'));
}
textareaRef.current.focus();
}
setVisibility(visibility);