diff --git a/assets/javascripts/app/app.coffee b/assets/javascripts/app/app.coffee index b55e552c8b..b19068f8da 100644 --- a/assets/javascripts/app/app.coffee +++ b/assets/javascripts/app/app.coffee @@ -11,6 +11,7 @@ try @initErrorTracking() catch return unless @browserCheck() + @analiticsAlreadyShown = false @el = $('._app') @localStorage = new LocalStorageStore @serviceWorker = new app.ServiceWorker if app.ServiceWorker.isEnabled() @@ -216,7 +217,7 @@ onCookieBlocked: (key, value, actual) -> return if @cookieBlocked @cookieBlocked = true - new app.views.Notif 'CookieBlocked', autoHide: null + new app.views.Notif 'CookieBlocked', autoHide: 2000 Raven.captureMessage "CookieBlocked/#{key}", level: 'warning', extra: {value, actual} return diff --git a/assets/javascripts/lib/page.coffee b/assets/javascripts/lib/page.coffee index 7a5329f6a8..966a4bd323 100644 --- a/assets/javascripts/lib/page.coffee +++ b/assets/javascripts/lib/page.coffee @@ -200,6 +200,10 @@ page.track = (fn) -> track = -> return unless app.config.env == 'production' + return if app.analiticsAlreadyShown + + # only show the analitics cookie notification once + app.analiticsAlreadyShown = true consentGiven = Cookies.get('analyticsConsent') consentAsked = Cookies.get('analyticsConsentAsked') @@ -210,7 +214,7 @@ track = -> # Only ask for consent once per browser session Cookies.set('analyticsConsentAsked', '1') - new app.views.Notif 'AnalyticsConsent', autoHide: null + new app.views.Notif 'AnalyticsConsent', autoHide: 2000 return @resetAnalytics = ->