Skip to content

Commit

Permalink
Fix sending empty notifications (go-gitea#19589)
Browse files Browse the repository at this point in the history
- Don't send empty notifications on read notifications API.
  • Loading branch information
Gusted authored and AbdulrhmnGhanem committed Aug 23, 2022
1 parent a16e8b3 commit 0b8e495
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/api/v1/notify/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.Doer, targetStatus)
Expand Down

0 comments on commit 0b8e495

Please sign in to comment.