From fef9589fae4a8490ec9687d2e788a060292914c1 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Sat, 17 Aug 2019 22:55:40 +0200 Subject: [PATCH] Simplify service worker and don't show analytics setting/notification in development --- assets/javascripts/lib/page.coffee | 2 + .../templates/pages/settings_tmpl.coffee | 2 +- assets/stylesheets/application.css.scss | 3 +- .../components/_environment.scss.erb | 3 ++ views/service-worker.js.erb | 37 +------------------ 5 files changed, 9 insertions(+), 38 deletions(-) create mode 100644 assets/stylesheets/components/_environment.scss.erb diff --git a/assets/javascripts/lib/page.coffee b/assets/javascripts/lib/page.coffee index 91d73432..7a5329f6 100644 --- a/assets/javascripts/lib/page.coffee +++ b/assets/javascripts/lib/page.coffee @@ -199,6 +199,8 @@ page.track = (fn) -> return track = -> + return unless app.config.env == 'production' + consentGiven = Cookies.get('analyticsConsent') consentAsked = Cookies.get('analyticsConsentAsked') diff --git a/assets/javascripts/templates/pages/settings_tmpl.coffee b/assets/javascripts/templates/pages/settings_tmpl.coffee index 94afe3df..d5cb0985 100644 --- a/assets/javascripts/templates/pages/settings_tmpl.coffee +++ b/assets/javascripts/templates/pages/settings_tmpl.coffee @@ -19,7 +19,7 @@ app.templates.settingsPage = (settings) -> """ Automatically download documentation for offline use Only enable this when bandwidth isn't a concern to you. -