summaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js')
-rw-r--r--static/js/controllers/comments_controller.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/static/js/controllers/comments_controller.js b/static/js/controllers/comments_controller.js
index d82caad..5f454df 100644
--- a/static/js/controllers/comments_controller.js
+++ b/static/js/controllers/comments_controller.js
@@ -43,7 +43,11 @@ export class CommentsController extends BaseController {
renderSubmitResponse(response_document) {
const new_comments = this.htmlFromResponse(response_document).getElementById("comment-section");
const comments = document.getElementById("comment-section");
- comments.replaceWith(new_comments);
+
+ if(comments)
+ comments.replaceWith(new_comments);
+ else
+ this.comments_node.appendChild(new_comments);
}
async submit(event) {