Also do this on submissions too...
This commit is contained in:
parent
a258a809db
commit
1a407090d9
1 changed files with 11 additions and 10 deletions
|
@ -489,19 +489,20 @@
|
||||||
|
|
||||||
comments = JSON.parse(localStorage.getItem("old-comment-counts")) || {}
|
comments = JSON.parse(localStorage.getItem("old-comment-counts")) || {}
|
||||||
lastCount = comments['{{p.id}}']
|
lastCount = comments['{{p.id}}']
|
||||||
if (lastCount)
|
|
||||||
{
|
var commentsToCheck = [
|
||||||
{% for c in p.comments %}
|
{% for c in p.comments -%}
|
||||||
{% if not (v and v.id==c.author_id) and not c.voted %}
|
{% if not (v and v.id==c.author_id) and not c.voted %}
|
||||||
if ({{c.created_utc*1000}} > lastCount.t)
|
[{{c.id}}, {{c.created_utc * 1000}}],
|
||||||
try {
|
|
||||||
document.getElementById("comment-{{c.id}}-only").classList.add('unread')
|
|
||||||
document.getElementById("comment-{{c.id}}").querySelector(".comment-user-info").innerHTML += "<span>~new~</span>";
|
|
||||||
}
|
|
||||||
catch(e) {}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
}
|
];
|
||||||
|
|
||||||
|
commentsToCheck = commentsToCheck.filter(comment => {
|
||||||
|
return comment[1] > lastCount.t
|
||||||
|
}).map(comment => comment[0]);
|
||||||
|
|
||||||
|
if (lastCount) commentsAddUnreadIndicator(commentsToCheck);
|
||||||
|
|
||||||
collapsedCommentStorageApply();
|
collapsedCommentStorageApply();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue