From fd10a0ad8784796a64f117ad4aa224e5b37cac05 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 22 Jul 2023 14:25:37 +0300 Subject: [PATCH] fix hat persisting on hatless users in popover --- files/assets/js/comments+post_listing.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/assets/js/comments+post_listing.js b/files/assets/js/comments+post_listing.js index 26e948e9c..f9e8705f3 100644 --- a/files/assets/js/comments+post_listing.js +++ b/files/assets/js/comments+post_listing.js @@ -109,6 +109,9 @@ document.addEventListener("click", function(e) { if (author["hat"]) { popover.getElementsByClassName('pop-hat')[0].src = author['hat'] + "?h=7" } + else { + popover.getElementsByClassName('pop-hat')[0].removeAttribute('src'); + } popover.getElementsByClassName('pop-username')[0].innerHTML = author["username"] if (popover.getElementsByClassName('pop-bio').length > 0) { popover.getElementsByClassName('pop-bio')[0].innerHTML = author["bio_html"]