From 71f4797027314156b8763f37e766fdd9e146d199 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 30 Dec 2022 16:20:09 +0200 Subject: [PATCH] fix highlighting comments --- files/assets/js/submission.js | 5 +++-- files/templates/comments.html | 10 +--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/files/assets/js/submission.js b/files/assets/js/submission.js index f0a1d3791a..6195e1a8dd 100644 --- a/files/assets/js/submission.js +++ b/files/assets/js/submission.js @@ -4,8 +4,9 @@ function highlight_unread(localstoragevar) { lastCount = comments[pid] if (lastCount) { - const comms = document.getElementById("comms").value - for (const c of comms) { + const comms = document.getElementById("comms").value.slice(0, -1).split(',') + for (let c of comms) { + c = c.split(':') if (c[1]*1000 > lastCount.t) { try {document.getElementById(`comment-${c[0]}-only`).classList.add('unread')} catch(e) {} diff --git a/files/templates/comments.html b/files/templates/comments.html index 11690d665f..d88de2af6c 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -764,15 +764,7 @@ {% if p %} {% set pid = p.id %} -
- {% set comms = [] %} - {% for c in p.comments %} - {% if not (v and v.id==c.author_id) and not c.voted %} - {{comms.append([c.id, c.created_utc])}} - {% endif %} - {% endfor %} - -
+ {% endif %} {% if offset %}