aboutsummaryrefslogtreecommitdiffhomepage
path: root/ui
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-06-30 17:35:06 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-06-30 17:35:06 -0700
commit240f8017557c356f3048d00c45c2664372d26fa9 (patch)
treeea3eac857ed274c7da976271ade63755581c9462 /ui
parent4c7fce0233dcc3914d9cffe46d509a58a2eb11e5 (diff)
Always mark the entry as read after fetching the pagination in unread mode
Diffstat (limited to 'ui')
-rw-r--r--ui/entry_unread.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/ui/entry_unread.go b/ui/entry_unread.go
index 0b6c001..05e506d 100644
--- a/ui/entry_unread.go
+++ b/ui/entry_unread.go
@@ -77,14 +77,12 @@ func (c *Controller) ShowUnreadEntry(w http.ResponseWriter, r *http.Request) {
prevEntryRoute = route.Path(c.router, "unreadEntry", "entryID", prevEntry.ID)
}
- // We change the status here, otherwise we cannot get the pagination for unread items.
- if entry.Status == model.EntryStatusUnread {
- err = c.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead)
- if err != nil {
- logger.Error("[Controller:ShowUnreadEntry] %v", err)
- html.ServerError(w, nil)
- return
- }
+ // Always mark the entry as read after fetching the pagination.
+ err = c.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead)
+ if err != nil {
+ logger.Error("[Controller:ShowUnreadEntry] %v", err)
+ html.ServerError(w, nil)
+ return
}
sess := session.New(c.store, ctx)