mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 22:53:43 +08:00
Merge pull request #4838 from vinothkannans/fix/read
FIX: 'read' filter in top menu showing new topics
This commit is contained in:
commit
b99aedeccc
|
@ -165,7 +165,7 @@ class TopicQuery
|
|||
|
||||
def list_read
|
||||
create_list(:read, unordered: true) do |topics|
|
||||
topics.order('COALESCE(tu.last_visited_at, topics.bumped_at) DESC')
|
||||
topics.where('tu.last_visited_at IS NOT NULL').order('tu.last_visited_at DESC')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -458,6 +458,8 @@ describe TopicQuery do
|
|||
|
||||
context 'list_unread' do
|
||||
it 'lists topics correctly' do
|
||||
new_topic = Fabricate(:post, user: creator).topic
|
||||
|
||||
expect(topic_query.list_unread.topics).to eq([])
|
||||
expect(topic_query.list_read.topics).to match_array([fully_read, partially_read])
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user