forked from MarseyWorld/MarseyWorld
fix console error
parent
60ce674b96
commit
b4397c320d
|
@ -296,10 +296,12 @@ 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"))
|
||||||
|
if (comments[pid]) {
|
||||||
const newTotal = parseInt(comments[pid].c) + 1
|
const newTotal = parseInt(comments[pid].c) + 1
|
||||||
comments[pid] = {c: newTotal, t: comments[pid].t}
|
comments[pid] = {c: newTotal, t: comments[pid].t}
|
||||||
localStorage.setItem("comment-counts", JSON.stringify(comments))
|
localStorage.setItem("comment-counts", JSON.stringify(comments))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
close_inline_emoji_modal();
|
close_inline_emoji_modal();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue