fix commenting

master
Aevann 2024-11-14 18:01:31 +02:00
parent b1e86067b3
commit 602b356116
1 changed files with 1 additions and 1 deletions

View File

@ -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