feat: only hide author like, boost, bookmark
This commit is contained in:
parent
c295a7cf90
commit
b3271ed5f2
1 changed files with 8 additions and 2 deletions
|
@ -1,8 +1,14 @@
|
||||||
export function renderMentions(mentions, rootSelector, ignoreAuthorUrls = []) {
|
export function renderMentions(mentions, rootSelector, ignoreAuthorUrls = []) {
|
||||||
const webMentionsSection = document.querySelector(rootSelector);
|
const webMentionsSection = document.querySelector(rootSelector);
|
||||||
|
const engagementTypes = ["like-of", "repost-of", "bookmark-of"];
|
||||||
|
|
||||||
mentions = mentions.filter(
|
mentions = mentions.filter(
|
||||||
(m) => m["wm-private"] !== true && !ignoreAuthorUrls.includes(m.author.url)
|
(m) =>
|
||||||
|
m["wm-private"] !== true &&
|
||||||
|
!(
|
||||||
|
ignoreAuthorUrls.includes(m.author.url) &&
|
||||||
|
engagementTypes.includes(m["wm-property"])
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (mentions.length) {
|
if (mentions.length) {
|
||||||
|
@ -17,7 +23,7 @@ export function renderMentions(mentions, rootSelector, ignoreAuthorUrls = []) {
|
||||||
"in-reply-to": "💬 {x} Replies",
|
"in-reply-to": "💬 {x} Replies",
|
||||||
};
|
};
|
||||||
|
|
||||||
["like-of", "repost-of", "bookmark-of"].forEach((type) => {
|
engagementTypes.forEach((type) => {
|
||||||
const mentionsOfType = mentions.filter((m) => m["wm-property"] === type);
|
const mentionsOfType = mentions.filter((m) => m["wm-property"] === type);
|
||||||
|
|
||||||
if (mentionsOfType.length) {
|
if (mentionsOfType.length) {
|
||||||
|
|
Loading…
Reference in a new issue