mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 11:46:23 +00:00
Allow to leave out some configurations even in production.
This commit is contained in:
parent
98c99d906e
commit
5a2cb5325b
2 changed files with 6 additions and 1 deletions
|
|
@ -28,6 +28,11 @@ function removePushDevice (user, pushDevice) {
|
|||
export const MAX_MESSAGE_LENGTH = 300;
|
||||
|
||||
async function sendFCMNotification (user, pushDevice, payload) {
|
||||
if (nconf.get('FIREBASE_PROJECT_ID') === undefined || nconf.get('FIREBASE_PROJECT_ID') === '') {
|
||||
logger.info('Will not send push notification, because Firebase is not configured.');
|
||||
return;
|
||||
}
|
||||
|
||||
const messaging = admin.messaging();
|
||||
if (messaging === undefined) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ let flagSlack;
|
|||
let subscriptionSlack;
|
||||
|
||||
try {
|
||||
if (IS_TEST || IS_PRODUCTION) {
|
||||
if ((IS_TEST || IS_PRODUCTION) && SLACK_FLAGGING_URL && SLACK_SUBSCRIPTIONS_URL) {
|
||||
flagSlack = new IncomingWebhook(SLACK_FLAGGING_URL);
|
||||
subscriptionSlack = new IncomingWebhook(SLACK_SUBSCRIPTIONS_URL);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue