mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-22 01:05:34 +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.value = spoilerText;
|
||||||
spoilerTextRef.current.focus();
|
spoilerTextRef.current.focus();
|
||||||
} else {
|
} 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();
|
textareaRef.current.focus();
|
||||||
if (replyToStatus.account.id !== currentAccount) {
|
|
||||||
textareaRef.current.value = `@${replyToStatus.account.acct} `;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
setVisibility(visibility);
|
setVisibility(visibility);
|
||||||
setSensitive(sensitive);
|
setSensitive(sensitive);
|
||||||
|
|
Loading…
Reference in a new issue