fix: 🐛 Correctly calculate mentions when replying to reblogs

This commit is contained in:
Jesse Wierzbinski 2024-12-25 17:25:16 +01:00
parent 4b1b6040db
commit 53cd4fc57d
No known key found for this signature in database

View file

@ -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} `;