mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Add user setting for marking entry as read on view
This commit is contained in:
parent
6046a74a64
commit
356d32c6fe
35 changed files with 84 additions and 29 deletions
|
@ -66,13 +66,18 @@ func (h *handler) showUnreadEntryPage(w http.ResponseWriter, r *http.Request) {
|
|||
prevEntryRoute = route.Path(h.router, "unreadEntry", "entryID", prevEntry.ID)
|
||||
}
|
||||
|
||||
// Always mark the entry as read after fetching the pagination.
|
||||
err = h.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead)
|
||||
if err != nil {
|
||||
html.ServerError(w, r, err)
|
||||
return
|
||||
if user.MarkReadOnView {
|
||||
entry.Status = model.EntryStatusRead
|
||||
}
|
||||
|
||||
// Restore entry read status if needed after fetching the pagination.
|
||||
if entry.Status == model.EntryStatusRead {
|
||||
err = h.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead)
|
||||
if err != nil {
|
||||
html.ServerError(w, r, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
entry.Status = model.EntryStatusRead
|
||||
|
||||
sess := session.New(h.store, request.SessionID(r))
|
||||
view := view.New(h.tpl, r, sess)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue