mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
stop the /announcements call at controller level
This commit is contained in:
parent
5a13ee1077
commit
666bfdf967
2 changed files with 3 additions and 3 deletions
|
@ -6,6 +6,9 @@ logger = require("logger-sharelatex")
|
||||||
module.exports =
|
module.exports =
|
||||||
|
|
||||||
getUndreadAnnouncements: (req, res, next)->
|
getUndreadAnnouncements: (req, res, next)->
|
||||||
|
if !settings?.apis?.analytics?.url? or !settings.apis.blog.url?
|
||||||
|
return res.json []
|
||||||
|
|
||||||
user_id = AuthenticationController.getLoggedInUserId(req)
|
user_id = AuthenticationController.getLoggedInUserId(req)
|
||||||
logger.log {user_id}, "getting unread announcements"
|
logger.log {user_id}, "getting unread announcements"
|
||||||
AnnouncementsHandler.getUnreadAnnouncements user_id, (err, announcements)->
|
AnnouncementsHandler.getUnreadAnnouncements user_id, (err, announcements)->
|
||||||
|
|
|
@ -8,9 +8,6 @@ settings = require("settings-sharelatex")
|
||||||
module.exports =
|
module.exports =
|
||||||
|
|
||||||
getUnreadAnnouncements : (user_id, callback = (err, announcements)->)->
|
getUnreadAnnouncements : (user_id, callback = (err, announcements)->)->
|
||||||
if !settings?.apis?.analytics?.url? or !settings.apis.blog.url?
|
|
||||||
return callback null, []
|
|
||||||
|
|
||||||
async.parallel {
|
async.parallel {
|
||||||
lastEvent: (cb)->
|
lastEvent: (cb)->
|
||||||
AnalyticsManager.getLastOccurance user_id, "announcement-alert-dismissed", cb
|
AnalyticsManager.getLastOccurance user_id, "announcement-alert-dismissed", cb
|
||||||
|
|
Loading…
Reference in a new issue