From 50332c6800cba76f008089b5bcecb6a3247df9dc Mon Sep 17 00:00:00 2001 From: Asaf Gartner Date: Mon, 7 Feb 2022 15:11:26 +0200 Subject: [PATCH] Fixed "mark all as read" --- src/hmndata/threads_and_posts_helper.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hmndata/threads_and_posts_helper.go b/src/hmndata/threads_and_posts_helper.go index 90b24411..a51cbc09 100644 --- a/src/hmndata/threads_and_posts_helper.go +++ b/src/hmndata/threads_and_posts_helper.go @@ -155,7 +155,9 @@ func FetchThreads( row := *iresult.(*resultRow) hasRead := false - if row.ThreadLastReadTime != nil && row.ThreadLastReadTime.After(row.LastPost.PostDate) { + if currentUser != nil && currentUser.MarkedAllReadAt.After(row.LastPost.PostDate) { + hasRead = true + } else if row.ThreadLastReadTime != nil && row.ThreadLastReadTime.After(row.LastPost.PostDate) { hasRead = true } else if row.ForumLastReadTime != nil && row.ForumLastReadTime.After(row.LastPost.PostDate) { hasRead = true @@ -413,7 +415,9 @@ func FetchPosts( row := *iresult.(*resultRow) hasRead := false - if row.ThreadLastReadTime != nil && row.ThreadLastReadTime.After(row.Post.PostDate) { + if currentUser != nil && currentUser.MarkedAllReadAt.After(row.Post.PostDate) { + hasRead = true + } else if row.ThreadLastReadTime != nil && row.ThreadLastReadTime.After(row.Post.PostDate) { hasRead = true } else if row.ForumLastReadTime != nil && row.ForumLastReadTime.After(row.Post.PostDate) { hasRead = true