mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-04-01 23:29:12 +02:00
Merge pull request #766 from Retrospring/fix/comment-error-on-answer-pages
Prevent error when commenting via an answer page
This commit is contained in:
commit
0090d1ca4a
1 changed files with 4 additions and 1 deletions
|
@ -38,7 +38,10 @@ export function commentCreateHandler(event: KeyboardEvent): boolean {
|
||||||
|
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
document.querySelector(`#ab-comments-${id}`).innerHTML = data.render;
|
document.querySelector(`#ab-comments-${id}`).innerHTML = data.render;
|
||||||
document.querySelector(`#ab-comment-count-${id}`).innerHTML = data.count;
|
const commentCount = document.getElementById(`#ab-comment-count-${id}`);
|
||||||
|
if (commentCount) {
|
||||||
|
commentCount.innerHTML = data.count;
|
||||||
|
}
|
||||||
input.value = '';
|
input.value = '';
|
||||||
counter.innerHTML = String(160);
|
counter.innerHTML = String(160);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue