Improve notification (#8835)
* Improve notifications * batch load user * Update notification only when read * Fix reorder * fix lint * fix test * fix lint * make function meaningful * fix comment
This commit is contained in:
parent
555b1f6581
commit
bb6879d339
7 changed files with 299 additions and 36 deletions
|
@ -68,6 +68,25 @@ func Notifications(c *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
repos, err := notifications.LoadRepos()
|
||||
if err != nil {
|
||||
c.ServerError("LoadRepos", err)
|
||||
return
|
||||
}
|
||||
if err := repos.LoadAttributes(); err != nil {
|
||||
c.ServerError("LoadAttributes", err)
|
||||
return
|
||||
}
|
||||
|
||||
if err := notifications.LoadIssues(); err != nil {
|
||||
c.ServerError("LoadIssues", err)
|
||||
return
|
||||
}
|
||||
if err := notifications.LoadComments(); err != nil {
|
||||
c.ServerError("LoadComments", err)
|
||||
return
|
||||
}
|
||||
|
||||
total, err := models.GetNotificationCount(c.User, status)
|
||||
if err != nil {
|
||||
c.ServerError("ErrGetNotificationCount", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue