diff --git a/services/web/app/coffee/Features/Announcements/AnnouncementsController.coffee b/services/web/app/coffee/Features/Announcements/AnnouncementsController.coffee index 5545ebcc26..ed3d8eee1e 100644 --- a/services/web/app/coffee/Features/Announcements/AnnouncementsController.coffee +++ b/services/web/app/coffee/Features/Announcements/AnnouncementsController.coffee @@ -6,6 +6,9 @@ logger = require("logger-sharelatex") module.exports = getUndreadAnnouncements: (req, res, next)-> + if !settings?.apis?.analytics?.url? or !settings.apis.blog.url? + return res.json [] + user_id = AuthenticationController.getLoggedInUserId(req) logger.log {user_id}, "getting unread announcements" AnnouncementsHandler.getUnreadAnnouncements user_id, (err, announcements)-> diff --git a/services/web/app/coffee/Features/Announcements/AnnouncementsHandler.coffee b/services/web/app/coffee/Features/Announcements/AnnouncementsHandler.coffee index b1173dbb78..a27608343a 100644 --- a/services/web/app/coffee/Features/Announcements/AnnouncementsHandler.coffee +++ b/services/web/app/coffee/Features/Announcements/AnnouncementsHandler.coffee @@ -8,9 +8,6 @@ settings = require("settings-sharelatex") module.exports = getUnreadAnnouncements : (user_id, callback = (err, announcements)->)-> - if !settings?.apis?.analytics?.url? or !settings.apis.blog.url? - return callback null, [] - async.parallel { lastEvent: (cb)-> AnalyticsManager.getLastOccurance user_id, "announcement-alert-dismissed", cb