Jasper van Merle 6 年之前
父節點
當前提交
22094f7dcf
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      assets/javascripts/lib/page.coffee
  2. 2 2
      assets/javascripts/views/layout/document.coffee

+ 2 - 2
assets/javascripts/lib/page.coffee

@@ -208,12 +208,12 @@ 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: false
   return
 
 @resetAnalytics = ->
   for cookie in document.cookie.split(/;\s?/)
     name = cookie.split('=')[0]
-    if name[0] == '_'
+    if name[0] == '_' && name[1] != '_'
       Cookies.expire(name)
   return

+ 2 - 2
assets/javascripts/views/layout/document.coffee

@@ -80,6 +80,6 @@ class app.views.Document extends app.View
       when 'reboot'             then app.reboot()
       when 'hard-reload'        then app.reload()
       when 'reset'              then app.reset() if confirm('Are you sure you want to reset DevDocs?')
-      when 'accept-analytics'   then Cookies.set('analyticsConsent', '1') && app.reboot()
-      when 'decline-analytics'  then Cookies.set('analyticsConsent', '0') && app.reboot()
+      when 'accept-analytics'   then Cookies.set('analyticsConsent', '1', expires: 1e8) && app.reboot()
+      when 'decline-analytics'  then Cookies.set('analyticsConsent', '0', expires: 1e8) && app.reboot()
     return