Update notification table with only latest data (#16445)
When marking notifications read the results may be returned out of order or be delayed. This PR sends a sequence number to gitea so that the browser can ensure that only the results of the latest notification change are shown. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
b08e14bbcf
commit
93f31e1897
3 changed files with 15 additions and 5 deletions
|
@ -50,6 +50,7 @@ func Notifications(c *context.Context) {
|
|||
return
|
||||
}
|
||||
if c.QueryBool("div-only") {
|
||||
c.Data["SequenceNumber"] = c.Query("sequence-number")
|
||||
c.HTML(http.StatusOK, tplNotificationDiv)
|
||||
return
|
||||
}
|
||||
|
@ -175,6 +176,7 @@ func NotificationStatusPost(c *context.Context) {
|
|||
return
|
||||
}
|
||||
c.Data["Link"] = setting.AppURL + "notifications"
|
||||
c.Data["SequenceNumber"] = c.Req.PostFormValue("sequence-number")
|
||||
|
||||
c.HTML(http.StatusOK, tplNotificationDiv)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue