summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-09-08 12:46:35 +0800
committerEltrac <hi@guhub.cn>2025-09-08 12:46:35 +0800
commitb83f18f34d9c53f821bb5b13fb316adf34f888dd (patch)
tree476de25a6971e3dc35a318d94b941e05250a57f3
parentdffafd4684a70e82188a4d40cc7738dcd1760400 (diff)
fix: problem previous commit fails to fix
see commit fe7ac94a9807f7d604c2f29c205ac9fcb31d7248
-rw-r--r--layouts/_partials/scripts/action-menu-js.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/layouts/_partials/scripts/action-menu-js.html b/layouts/_partials/scripts/action-menu-js.html
index 699496dd..38527b4e 100644
--- a/layouts/_partials/scripts/action-menu-js.html
+++ b/layouts/_partials/scripts/action-menu-js.html
@@ -66,8 +66,9 @@ function initializeCommentCount() {
const discussion = giscusData.giscus.discussion;
const totalComments = (discussion.totalCommentCount || 0) + (discussion.totalReplyCount || 0);
// set comment count
- commentCountEl.textContent = totalComments.toString() || '0';
- }
+ commentCountEl.textContent = totalComments.toString();
+ // if no discussion found, set to 0
+ } else commentCountEl.textContent = '0';
});
});