summaryrefslogtreecommitdiff
path: root/layouts/_partials/scripts
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
commita2b58b628004d153a4ba820b8c02d2acc7e39a99 (patch)
tree476de25a6971e3dc35a318d94b941e05250a57f3 /layouts/_partials/scripts
parent814fcada348b806d53a30089dba0d8c8bb302dcb (diff)
fix: problem previous commit fails to fix
see commit e433ef46d792ccaeb732766e2abbab24ce4a6bbc [formerly fe7ac94a9807f7d604c2f29c205ac9fcb31d7248] Former-commit-id: b83f18f34d9c53f821bb5b13fb316adf34f888dd
Diffstat (limited to 'layouts/_partials/scripts')
-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';
});
});