mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-21 16:55:25 +03:00
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:
parent
45babb150b
commit
a41b18b331
1 changed files with 8 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue