From 0befcc29b8d06aebd35cd697a63c2391cb3ff29a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 10 Oct 2021 05:54:23 +0200 Subject: [PATCH] dfsfsd --- files/assets/js/new_comments_count.js | 2 +- files/templates/comments.html | 10 +++++----- files/templates/submission.html | 10 ++++++---- files/templates/submission_listing.html | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/files/assets/js/new_comments_count.js b/files/assets/js/new_comments_count.js index 4543af258..24846862c 100644 --- a/files/assets/js/new_comments_count.js +++ b/files/assets/js/new_comments_count.js @@ -16,7 +16,7 @@ if (typeof showNewCommentCounts === 'undefined') { const LAST_CACHE_CLEAN_ID = "last-cache-clean" const EXPIRE_INTERVAL_MILLIS = 5 * 24 * 60 * 60 * 1000 - const CACHE_CLEAN_INTERVAL = 60 * 60 * 1000 // 1 hour + const CACHE_CLEAN_INTERVAL = 60 * 60 * 1000 function cleanCache() { const lastCacheClean = JSON.parse(localStorage.getItem(LAST_CACHE_CLEAN_ID)) || Date.now() diff --git a/files/templates/comments.html b/files/templates/comments.html index 66a892a1c..b8be729fc 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -432,19 +432,19 @@ {% if v and request.path.startswith('/@') and v.admin_level == 0 %} {% if voted==1 %}
  • {% endif %} {% elif v %} -
  • +
  • {% else %} -
  • +
  • {% endif %} -
  • {{score}}
  • +
  • {{score}}
  • {% if v and request.path.startswith('/@') and v.admin_level == 0 %} {% if voted==-1 %}
  • {% endif %} {% elif v %} -
  • +
  • {% else %} -
  • +
  • {% endif %} diff --git a/files/templates/submission.html b/files/templates/submission.html index 462b93c20..a5ab1c42b 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -728,10 +728,12 @@ showNewCommentCounts('{{p.id}}', {{p.comment_count}}) {% endif %} - const comments = JSON.parse(localStorage.getItem("comment-counts")) || {} - const newTotal = {{p.comment_count}} || ((comments['{{p.id}}'] || { c: 0 }).c + 1) - comments['{{p.id}}'] = { c: newTotal, t: Date.now() } - window.localStorage.setItem("comment-counts", JSON.stringify(comments)) + {% if "?context" not in request.full_path %} + const comments = JSON.parse(localStorage.getItem("comment-counts")) || {} + const newTotal = {{p.comment_count}} || ((comments['{{p.id}}'] || { c: 0 }).c + 1) + comments['{{p.id}}'] = { c: newTotal, t: Date.now() } + window.localStorage.setItem("comment-counts", JSON.stringify(comments)) + {% endif %} })() diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index cb0fe9956..c64dd5b6b 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -26,10 +26,10 @@