Skip to content

Commit 404bc15

Browse files
fix: ban-hn works again
1 parent f97777b commit 404bc15

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ban-hn.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
};
5959

6060
const getUser = (node) =>
61-
node.querySelector(".hnuser")?.textContent.toLowerCase();
61+
node.parentNode.parentNode
62+
.querySelector(".hnuser")
63+
?.textContent.toLowerCase();
6264

6365
const getData = () => JSON.parse(localStorage.getItem(keys.users));
6466

@@ -104,6 +106,7 @@
104106
)?.textContent || "";
105107

106108
const key = keys.users;
109+
console.log(event, target, event.target, event.currentTarget);
107110
const user = getUser(target);
108111
const banned = isBanned(user);
109112
const data = getData();

0 commit comments

Comments
 (0)