mirror of
https://gitlab.com/tildes/tildes.git
synced 2026-04-17 14:59:11 +02:00
Fix comments_since_last_visit on first visit
On a user's first visit to a topic, this attribute wasn't being set.
This commit is contained in:
@@ -109,6 +109,8 @@ class TopicQuery(PaginatedQuery):
|
||||
topic.bookmark_created_time = result.created_time
|
||||
|
||||
topic.last_visit_time = result.visit_time
|
||||
|
||||
topic.comments_since_last_visit = None
|
||||
if result.num_comments is not None:
|
||||
new_comments = topic.num_comments - result.num_comments
|
||||
# prevent showing negative "new comments" due to deletions
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
{% if request.user
|
||||
and request.user.track_comment_visits
|
||||
and not request.user.collapse_old_comments
|
||||
and topic.comments_since_last_visit > 0 %}
|
||||
and topic.comments_since_last_visit %}
|
||||
<button class="btn btn-sm btn-light" data-js-comment-collapse-read-button>Collapse read</button>
|
||||
{% endif %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user