mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38: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 "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
const peopleToMention = relation.note.mentions
|
const note = relation.note.reblog || relation.note;
|
||||||
.concat(relation.note.account)
|
|
||||||
|
const peopleToMention = note.mentions
|
||||||
|
.concat(note.account)
|
||||||
// Deduplicate mentions
|
// Deduplicate mentions
|
||||||
.filter((men, i, a) => a.indexOf(men) === i)
|
.filter((men, i, a) => a.indexOf(men) === i)
|
||||||
// Remove self
|
// Remove self
|
||||||
.filter((men) => men.id !== identity.value?.account.id);
|
.filter((men) => men.id !== identity.value?.account.id);
|
||||||
|
|
||||||
|
if (peopleToMention.length === 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
const mentions = peopleToMention.map((me) => `@${me.acct}`).join(" ");
|
const mentions = peopleToMention.map((me) => `@${me.acct}`).join(" ");
|
||||||
|
|
||||||
return `${mentions} `;
|
return `${mentions} `;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue