mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-04-14 11:36:45 +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;
|
export const MAX_MESSAGE_LENGTH = 300;
|
||||||
|
|
||||||
async function sendFCMNotification (user, pushDevice, payload) {
|
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();
|
const messaging = admin.messaging();
|
||||||
if (messaging === undefined) {
|
if (messaging === undefined) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ let flagSlack;
|
||||||
let subscriptionSlack;
|
let subscriptionSlack;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (IS_TEST || IS_PRODUCTION) {
|
if ((IS_TEST || IS_PRODUCTION) && SLACK_FLAGGING_URL && SLACK_SUBSCRIPTIONS_URL) {
|
||||||
flagSlack = new IncomingWebhook(SLACK_FLAGGING_URL);
|
flagSlack = new IncomingWebhook(SLACK_FLAGGING_URL);
|
||||||
subscriptionSlack = new IncomingWebhook(SLACK_SUBSCRIPTIONS_URL);
|
subscriptionSlack = new IncomingWebhook(SLACK_SUBSCRIPTIONS_URL);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue