diff --git a/functions/src/Integrations/firebase-discord.ts b/functions/src/Integrations/firebase-discord.ts index d3f06a8ef1..c80d1c0dcd 100644 --- a/functions/src/Integrations/firebase-discord.ts +++ b/functions/src/Integrations/firebase-discord.ts @@ -17,7 +17,7 @@ export const notifyPinAccepted = functions.firestore const { _id, type } = info await axios .post(DISCORD_WEBHOOK_URL, { - content: `📍 *New ${type}* pin from ${_id}. \n Location here ${SITE_URL}/map/#${_id}`, + content: `📍 *New ${type}* pin from ${_id}. \n Location here <${SITE_URL}/map/#${_id}>`, }) .then(handleResponse, handleErr) .catch(handleErr) @@ -34,7 +34,7 @@ export const notifyHowToAccepted = functions.firestore await axios .post(DISCORD_WEBHOOK_URL, { content: `📓 Yeah! New How To **${title}** by *${_createdBy}* - check it out: ${SITE_URL}/how-to/${slug}`, + check it out: <${SITE_URL}/how-to/${slug}>`, }) .then(handleResponse, handleErr) .catch(handleErr) @@ -53,7 +53,7 @@ export const notifyEventAccepted = functions.firestore await axios .post(DISCORD_WEBHOOK_URL, { content: `📅 Jeej new event in **${location}** by *${user}* posted here: - ${url}`, + <${url}>`, }) .then(handleResponse, handleErr) .catch(handleErr) diff --git a/functions/src/Integrations/firebase-slack.ts b/functions/src/Integrations/firebase-slack.ts index c9fb4276c9..9c3ee7012a 100644 --- a/functions/src/Integrations/firebase-slack.ts +++ b/functions/src/Integrations/firebase-slack.ts @@ -11,7 +11,9 @@ export const notifyNewPin = functions.firestore .document('v3_mappins/{pinId}') .onWrite((change, context) => { const info = change.after.exists ? change.after.data() : null - if (info === null || info.moderation !== 'awaiting-moderation') { + const prevInfo = change.before.exists ? change.before.data() : null + const prevModeration = (prevInfo !== null) ? prevInfo.moderation : null; + if (info === null || info.moderation !== 'awaiting-moderation' || prevModeration === 'awaiting-moderation') { return }