diff options
author | HombreLaser <sebastian-440@live.com> | 2024-02-28 16:54:16 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2024-02-28 16:54:16 -0600 |
commit | b918a93f6854ced395e313dae0501b9267d6da30 (patch) | |
tree | cd39ca2c61b3a605deccc53e995e36b11b07c19d /static | |
parent | 25bfb67759844e02f6e4824f3e074b9eb3cd4960 (diff) |
Fix renderSubmitResponse
Diffstat (limited to 'static')
-rw-r--r-- | static/js/controllers/comments_controller.js | 6 |
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) { |