From 602b35611651265c3180cc9addc0c1008ec5a935 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 14 Nov 2024 18:01:31 +0200 Subject: [PATCH] fix commenting --- files/assets/js/comments_v.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/assets/js/comments_v.js b/files/assets/js/comments_v.js index ab9419956..845226762 100644 --- a/files/assets/js/comments_v.js +++ b/files/assets/js/comments_v.js @@ -293,7 +293,7 @@ function distinguished_toggle(t, fullname) { function post_comment(fullname, hide) { const pids = document.getElementsByClassName('pid') //to account for crosspost embed - if (pids) { + if (pids.length) { //need .length, getElementsByClassName is always True const pid = pids[pids.length - 1].value const comments = JSON.parse(localStorage.getItem("comment-counts")) const newTotal = parseInt(comments[pid].c) + 1