diff --git a/tildes/tildes/models/topic/topic_query.py b/tildes/tildes/models/topic/topic_query.py index 773511b..d2f2f60 100644 --- a/tildes/tildes/models/topic/topic_query.py +++ b/tildes/tildes/models/topic/topic_query.py @@ -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 diff --git a/tildes/tildes/templates/topic.jinja2 b/tildes/tildes/templates/topic.jinja2 index ae743ae..467f339 100644 --- a/tildes/tildes/templates/topic.jinja2 +++ b/tildes/tildes/templates/topic.jinja2 @@ -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 %} {% endif %}