1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Improve naviguation

This commit is contained in:
Frédéric Guillot 2017-12-04 20:40:23 -08:00
parent 5546dd99a5
commit 0e6fc2db1e
3 changed files with 53 additions and 28 deletions

View file

@ -191,15 +191,6 @@ func (c *Controller) ShowUnreadEntry(ctx *core.Context, request *core.Request, r
return
}
if entry.Status == model.EntryStatusUnread {
err = c.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead)
if err != nil {
log.Println(err)
response.HTML().ServerError(nil)
return
}
}
args, err := c.getCommonTemplateArgs(ctx)
if err != nil {
response.HTML().ServerError(err)
@ -225,6 +216,16 @@ func (c *Controller) ShowUnreadEntry(ctx *core.Context, request *core.Request, r
prevEntryRoute = ctx.Route("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 {
log.Println(err)
response.HTML().ServerError(nil)
return
}
}
response.HTML().Render("entry", args.Merge(tplParams{
"entry": entry,
"prevEntry": prevEntry,