mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
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:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user