forum: fix topics being incorrectly marked as unread (again).

Second attempt at 71690cacc. Fix topics on page 2+ being still marked as
unread after the user has marked all topics as read.
This commit is contained in:
evazion
2020-01-22 18:33:03 -06:00
parent 22cb0ea322
commit cc96f30e47
6 changed files with 69 additions and 90 deletions

View File

@@ -24,9 +24,8 @@ class ForumTopicsController < ApplicationController
params[:limit] ||= 40
@forum_topics = ForumTopic.paginated_search(params)
@read_forum_topics = @forum_topics.read_by_user(CurrentUser.user)
@forum_topics = @forum_topics.includes(:creator, :updater).load if request.format.html?
@forum_topics = @forum_topics.includes(:creator, :updater, :forum_topic_visit_by_current_user).load if request.format.html?
@forum_topics = @forum_topics.includes(:creator, :original_post).load if request.format.atom?
respond_with(@forum_topics)