diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-05-03 02:27:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 21:27:42 -0500 |
commit | c8ec2261a99590f15699e9147a28e4b61c1c2ea5 (patch) | |
tree | 572db0bce06c6d07187e8c285b01325dfa70c63a /routers/api/v1/notify | |
parent | 438646e0b55138d2b18313142072236e8f178c29 (diff) | |
download | gitea-c8ec2261a99590f15699e9147a28e4b61c1c2ea5.tar.gz gitea-c8ec2261a99590f15699e9147a28e4b61c1c2ea5.zip |
Fix sending empty notifications (#19589)
- Don't send empty notifications on read notifications API.
Diffstat (limited to 'routers/api/v1/notify')
-rw-r--r-- | routers/api/v1/notify/repo.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/notify/repo.go b/routers/api/v1/notify/repo.go index a36bbc6b42..0f6b90b05d 100644 --- a/routers/api/v1/notify/repo.go +++ b/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.Doer, targetStatus) |