Skip to content

Commit

Permalink
Don't post duplicate messages if event.eventSlackAnnouncementsChannel…
Browse files Browse the repository at this point in the history
…Id == DEFAULT_SLACK_EVENT_CHANNEL
  • Loading branch information
ebanner committed Jul 23, 2024
1 parent b46d86f commit 6ef7fcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/event-reminders-hourly/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 6ef7fcd

Please sign in to comment.