Fix auto-prepending mentions when replying

Prepend not just the reply-to status's acct, but also all mentions' acct
BUT excluding self
This commit is contained in:
Lim Chee Aun 2022-12-16 00:50:38 +08:00
parent 45babb150b
commit a41b18b331

View file

@ -89,10 +89,15 @@ function Compose({
spoilerTextRef.current.value = spoilerText;
spoilerTextRef.current.focus();
} else {
const mentions = new Set([
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.focus();
if (replyToStatus.account.id !== currentAccount) {
textareaRef.current.value = `@${replyToStatus.account.acct} `;
}
}
setVisibility(visibility);
setSensitive(sensitive);