From 1f8ce7c249b8ce821bc95197d50bef188bd88791 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Sat, 8 Feb 2020 15:31:31 -0500 Subject: [PATCH] do not show block control for comments by a logged-in user --- .../resources/bubble/rule/social/block/site/HackerNews.js.hbs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bubble-server/src/main/resources/bubble/rule/social/block/site/HackerNews.js.hbs b/bubble-server/src/main/resources/bubble/rule/social/block/site/HackerNews.js.hbs index 2a46c137..05676798 100644 --- a/bubble-server/src/main/resources/bubble/rule/social/block/site/HackerNews.js.hbs +++ b/bubble-server/src/main/resources/bubble/rule/social/block/site/HackerNews.js.hbs @@ -1,4 +1,6 @@ function {{JS_PREFIX}}_apply_blocks(blocked_users) { + const currentUser = document.getElementById('me'); + const currentUserName = (currentUser !== null) ? currentUser.innerText : null; let commentTable = document.querySelector('table.comment-tree'); if (commentTable === null) { console.warn('commentTable not found, looking for hnmain table'); @@ -39,7 +41,7 @@ function {{JS_PREFIX}}_apply_blocks(blocked_users) { i++; } else { const existingBlock = comment.querySelector('.bubble_block'); - if (existingBlock === null) { + if (existingBlock === null && (currentUserName === null || currentUserName !== author)) { const ageElement = comment.querySelector('.age'); const blockNode = document.createElement('span'); blockNode.className = "bubble_block";