From 6ef7fcd50c6595aac967782688b23b23e1614497 Mon Sep 17 00:00:00 2001 From: Edward Banner Date: Tue, 23 Jul 2024 12:45:12 -0400 Subject: [PATCH] Don't post duplicate messages if event.eventSlackAnnouncementsChannelId == DEFAULT_SLACK_EVENT_CHANNEL --- functions/event-reminders-hourly/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/event-reminders-hourly/index.js b/functions/event-reminders-hourly/index.js index 91f7c14..7051d55 100644 --- a/functions/event-reminders-hourly/index.js +++ b/functions/event-reminders-hourly/index.js @@ -93,7 +93,7 @@ const handler = async function (handlerEvent, handlerContext) { const eventDate = DateTime.fromISO(event.startDateLocalized); const announcementsChannels = [DEFAULT_SLACK_EVENT_CHANNEL]; - if (event.eventSlackAnnouncementsChannelId) { + if (event.eventSlackAnnouncementsChannelId && event.eventSlackAnnouncementsChannelId !== DEFAULT_SLACK_EVENT_CHANNEL) { announcementsChannels.push(event.eventSlackAnnouncementsChannelId); } @@ -236,7 +236,7 @@ const handler = async function (handlerEvent, handlerContext) { } const channels = [DEFAULT_SLACK_EVENT_CHANNEL]; - if (event.eventSlackAnnouncementsChannelId) { + if (event.eventSlackAnnouncementsChannelId && event.eventSlackAnnouncementsChannelId !== DEFAULT_SLACK_EVENT_CHANNEL) { channels.push(event.eventSlackAnnouncementsChannelId); }