mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 06:06:41 +01:00
Fix one-char space inserted when replying to own posts
This commit is contained in:
parent
d0579a57d6
commit
1c18184ef4
1 changed files with 9 additions and 5 deletions
|
@ -93,11 +93,15 @@ function Compose({
|
||||||
replyToStatus.account.acct,
|
replyToStatus.account.acct,
|
||||||
...replyToStatus.mentions.map((m) => m.acct),
|
...replyToStatus.mentions.map((m) => m.acct),
|
||||||
]);
|
]);
|
||||||
textareaRef.current.value = `${[...mentions]
|
const allMentions = [...mentions].filter(
|
||||||
.filter((m) => m !== currentAccountInfo.acct) // Excluding self
|
(m) => m !== currentAccountInfo.acct,
|
||||||
.map((m) => `@${m}`)
|
);
|
||||||
.join(' ')} `;
|
if (allMentions.length > 0) {
|
||||||
textareaRef.current.dispatchEvent(new Event('input'));
|
textareaRef.current.value = `${allMentions
|
||||||
|
.map((m) => `@${m}`)
|
||||||
|
.join(' ')} `;
|
||||||
|
textareaRef.current.dispatchEvent(new Event('input'));
|
||||||
|
}
|
||||||
textareaRef.current.focus();
|
textareaRef.current.focus();
|
||||||
}
|
}
|
||||||
setVisibility(visibility);
|
setVisibility(visibility);
|
||||||
|
|
Loading…
Reference in a new issue