X-Git-Url: http://unremediatedgender.space/source?p=Ultimately_Untrue_Thought.git;a=blobdiff_plain;f=theme%2Fstatic%2Fjs%2Fcomment_counts.js;fp=theme%2Fstatic%2Fjs%2Fcomment_counts.js;h=1a3d281c197699c85175c431470dc76464d52384;hp=d0df09b98e80f307c981403bc6a5946a42100f00;hb=8e77d0f6a684630ee8fad47150763ef9f49c0b05;hpb=26659deaecaa6b4835f6dfa0b16be6adf046e040 diff --git a/theme/static/js/comment_counts.js b/theme/static/js/comment_counts.js index d0df09b..1a3d281 100644 --- a/theme/static/js/comment_counts.js +++ b/theme/static/js/comment_counts.js @@ -1,11 +1,15 @@ function placeCommentCounts() { let containers = Array.from(document.querySelectorAll(".comments-link-container")); let paths = containers.map(function(span) { return span.dataset.path; }); + if (paths.length === 0) { + return; + } let request = new XMLHttpRequest(); request.open('POST', 'http://unremediatedgender.space/isso/count', true); request.setRequestHeader("Content-Type", "application/json"); + request.send(JSON.stringify(paths)); request.onload = function() {