Avoid showing more than once analitics consent

pull/1581/head
Enoc 4 years ago
parent 676296e36e
commit 5b57737c5f

@ -11,6 +11,7 @@
try @initErrorTracking() catch
return unless @browserCheck()
@showAnaliticsOne = 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

@ -200,7 +200,9 @@ page.track = (fn) ->
track = ->
return unless app.config.env == 'production'
return if app.analiticsAlreadyShown
app.analiticsAlreadyShown = true
consentGiven = Cookies.get('analyticsConsent')
consentAsked = Cookies.get('analyticsConsentAsked')
@ -210,7 +212,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 = ->

Loading…
Cancel
Save