From 897ffd72db1db11e5392687ef3aa6d1f1cb2df36 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 3 May 2022 03:03:18 +0200 Subject: [PATCH] Fix sending empty notifications - Don't send empty notifications on read notifications API. --- routers/api/v1/notify/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/api/v1/notify/repo.go b/routers/api/v1/notify/repo.go index a36bbc6b428ca..0f6b90b05d02f 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)