Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 7aac142

Browse files
committed
Fix multiple actors with one being someone user follows
1 parent 941b04e commit 7aac142

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

dashboard.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,11 @@ async function addMoreSpecificIdentifiers(list) {
185185
if (!(eventItem instanceof HTMLElement)) continue
186186
// eventItem should have only one className
187187
if (events.indexOf(eventItem.className) < 0) continue
188-
// First link is actor. I know this is not great.
189-
const actor = eventItem.querySelector('a')
190-
if (!actor) continue
191-
const fromFollowedPeople= following.indexOf(actor.pathname.slice(1)) >= 0
188+
189+
// Check if any links are to one of the followed people
190+
const fromFollowedPeople = Array.from(eventItem.querySelectorAll('a')).some(function(maybeActor) {
191+
return following.indexOf(maybeActor.pathname.slice(1)) >= 0
192+
})
192193
eventItem.classList.add(fromFollowedPeople ? 'by_followed_people' : 'by_internet')
193194
}
194195
}

0 commit comments

Comments
 (0)