dedupe channels

This commit is contained in:
Hongbo Wu
2024-05-03 14:43:18 +08:00
parent 0692ab0454
commit a9dd2d0d4c

View File

@ -598,8 +598,10 @@ const sendNotifications = async (
channels: Channel[],
digest: Digest
) => {
const deduplicateChannels = [...new Set(channels)]
await Promise.all(
channels.map(async (channel) => {
deduplicateChannels.map(async (channel) => {
switch (channel) {
case 'push':
return sendPushNotification(user.id, digest)