fix console error

master
Aevann 2024-11-14 23:17:53 +02:00
parent 60ce674b96
commit b4397c320d
1 changed files with 5 additions and 3 deletions

View File

@ -296,9 +296,11 @@ function post_comment(fullname, hide) {
if (pids.length) { //need .length, getElementsByClassName is always truthy if (pids.length) { //need .length, getElementsByClassName is always truthy
const pid = pids[pids.length - 1].value const pid = pids[pids.length - 1].value
const comments = JSON.parse(localStorage.getItem("comment-counts")) const comments = JSON.parse(localStorage.getItem("comment-counts"))
const newTotal = parseInt(comments[pid].c) + 1 if (comments[pid]) {
comments[pid] = {c: newTotal, t: comments[pid].t} const newTotal = parseInt(comments[pid].c) + 1
localStorage.setItem("comment-counts", JSON.stringify(comments)) comments[pid] = {c: newTotal, t: comments[pid].t}
localStorage.setItem("comment-counts", JSON.stringify(comments))
}
} }
close_inline_emoji_modal(); close_inline_emoji_modal();