From 3feea66b498ffe62b420ca6cf49a68cd78e24ab2 Mon Sep 17 00:00:00 2001 From: Alter Ego <0x7c48@gmail.com> Date: Fri, 10 Feb 2023 01:20:07 +0000 Subject: [PATCH] * Fix utils function hideComments. * Fix function name. --- assets/js/next-boot.js | 2 +- assets/js/utils.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/js/next-boot.js b/assets/js/next-boot.js index 8b55d29..76354fc 100644 --- a/assets/js/next-boot.js +++ b/assets/js/next-boot.js @@ -62,7 +62,7 @@ NexT.boot.refresh = function() { NexT.utils.registerCommonSwitch(); NexT.utils.domAddClass('#goto-comments', 'goto-comments-on'); } else { - NexT.utils.hideCommontes(); + NexT.utils.hideComments(); } NexT.utils.registerImageViewer(); diff --git a/assets/js/utils.js b/assets/js/utils.js index 2ef2605..1b5bcf3 100644 --- a/assets/js/utils.js +++ b/assets/js/utils.js @@ -481,8 +481,11 @@ NexT.utils = { }); }, - hideCommontes: function () { - document.querySelector('.post-comments').style.display = 'none'; + hideComments: function () { + let postComments = document.querySelector('.post-comments'); + if (postComments !== null) { + postComments.style.display = 'none'; + } }, hiddeLodingCmp: function (selector) {