🐛 Fix failed to push when no push subscription

This commit is contained in:
LittleSheep 2025-06-01 01:19:15 +08:00
parent 9a96cf68bb
commit fb2f138925

View File

@ -248,9 +248,12 @@ public class NotificationService(
private async Task _PushNotification(Notification notification,
IEnumerable<NotificationPushSubscription> subscriptions)
{
var subList = subscriptions.ToList();
if (subList.Count == 0) return;
var requestDict = new Dictionary<string, object>
{
["notifications"] = _BuildNotificationPayload(notification, subscriptions)
["notifications"] = _BuildNotificationPayload(notification, subList)
};
var client = httpFactory.CreateClient();