From: M. Taylor Saotome-Westlake Date: Sun, 18 Sep 2022 01:05:16 +0000 (-0700) Subject: special-case zero for comment count X-Git-Url: http://534655.efjtl6rk.asia/source?a=commitdiff_plain;h=c9201f74e57b28b539128380b87656bbcbacca7a;p=Ultimately_Untrue_Thought.git special-case zero for comment count Maybe tweaking some JavaScript will help me feel less gross. --- diff --git a/theme/static/js/comment_counts.js b/theme/static/js/comment_counts.js index 1a3d281..ced469a 100644 --- a/theme/static/js/comment_counts.js +++ b/theme/static/js/comment_counts.js @@ -18,6 +18,9 @@ function placeCommentCounts() { for (let [i, container] of containers.entries()) { let a = document.createElement('a'); let count = counts[i]; + if count === 0 { + count = "no"; + } let pluralizer = count === 1 ? "" : "s"; let text = document.createTextNode(`${count} comment${pluralizer}`); a.appendChild(text);