mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
fix: 🐛 Correctly calculate mentions when replying to reblogs
This commit is contained in:
parent
4b1b6040db
commit
53cd4fc57d
|
|
@ -150,13 +150,19 @@ const getMentions = () => {
|
|||
return "";
|
||||
}
|
||||
|
||||
const peopleToMention = relation.note.mentions
|
||||
.concat(relation.note.account)
|
||||
const note = relation.note.reblog || relation.note;
|
||||
|
||||
const peopleToMention = note.mentions
|
||||
.concat(note.account)
|
||||
// Deduplicate mentions
|
||||
.filter((men, i, a) => a.indexOf(men) === i)
|
||||
// Remove self
|
||||
.filter((men) => men.id !== identity.value?.account.id);
|
||||
|
||||
if (peopleToMention.length === 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
const mentions = peopleToMention.map((me) => `@${me.acct}`).join(" ");
|
||||
|
||||
return `${mentions} `;
|
||||
|
|
|
|||
Loading…
Reference in a new issue