Browse Source

Fix sending empty notifications (#19589) (#19590)

- Backport #19589
  - Don't send empty notifications on read notifications API.
tags/v1.16.8
Gusted 3 years ago committed by GitHub
parent
commit
82f24bedc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      routers/api/v1/notify/repo.go

2
routers/api/v1/notify/repo.go

@ -214,7 +214,7 @@ func ReadRepoNotifications(ctx *context.APIContext) {
targetStatus = models.NotificationStatusRead
}
changed := make([]*structs.NotificationThread, len(nl))
changed := make([]*structs.NotificationThread, 0, len(nl))
for _, n := range nl {
notif, err := models.SetNotificationStatus(n.ID, ctx.User, targetStatus)

Loading…
Cancel
Save