From 28092d6862fab138c2aa004f6bf02547682647e0 Mon Sep 17 00:00:00 2001 From: Geometrically <18202329+Geometrically@users.noreply.github.com> Date: Sun, 11 Apr 2021 14:31:21 -0700 Subject: [PATCH] Remove analytics consent (#163) * Remove analytics consent * Use watch for cookie popup visibility * Fix double scrollbar, delete account not centered --- components/ads/CookieConsent.vue | 21 +++++++++++++-------- layouts/default.vue | 1 - modules/analytics/lib/templates/plugin.js | 6 +++--- pages/dashboard/settings.vue | 9 ++++++--- privacy-toggles.js | 4 ++-- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/components/ads/CookieConsent.vue b/components/ads/CookieConsent.vue index 216a6627..68da9e15 100644 --- a/components/ads/CookieConsent.vue +++ b/components/ads/CookieConsent.vue @@ -25,21 +25,26 @@ import scopes from '~/privacy-toggles' export default { name: 'CookieConsent', fetch() { - // Get informations in the store - this.$store.dispatch('consent/loadFromCookies', this.$cookies) - if ( - !this.$store.state.consent.is_consent_given && - this.$route.path !== '/dashboard/privacy' - ) { - this.shown = true - } + this.checkVisibility() }, data() { return { shown: false, } }, + watch: { + $route() { + this.checkVisibility() + }, + }, methods: { + checkVisibility() { + this.$store.dispatch('consent/loadFromCookies', this.$cookies) + + this.shown = + !this.$store.state.consent.is_consent_given && + this.$route.path !== '/dashboard/privacy' + }, hide() { this.$store.commit('consent/set_consent', true) // Accept all scopes diff --git a/layouts/default.vue b/layouts/default.vue index 4d5cb222..1c708faf 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -212,7 +212,6 @@ export default { .layout { background-color: var(--color-bg); display: block; - height: 100vh; .site-header { height: var(--size-navbar-height); diff --git a/modules/analytics/lib/templates/plugin.js b/modules/analytics/lib/templates/plugin.js index 40ca0051..eb6b7aac 100644 --- a/modules/analytics/lib/templates/plugin.js +++ b/modules/analytics/lib/templates/plugin.js @@ -46,7 +46,7 @@ export default async function (ctx, inject) { ctx.app.head.script.push(script); } }; - if (isAnalyticsOn(ctx)) { + // if (isAnalyticsOn(ctx)) { // Inject unami const analyticsScript = { hid: UNAMI_LIB_TAG_ID, @@ -56,9 +56,9 @@ export default async function (ctx, inject) { defer: true, }; injectScript(analyticsScript); - } else { + // } else { // console.log("Analytics scope was denied.") - } + // } } diff --git a/pages/dashboard/settings.vue b/pages/dashboard/settings.vue index 0ccedf6e..5bde167a 100644 --- a/pages/dashboard/settings.vue +++ b/pages/dashboard/settings.vue @@ -103,9 +103,12 @@ will be removed from our servers. This cannot be reversed, so be careful! -
- Delete Account -
+ diff --git a/privacy-toggles.js b/privacy-toggles.js index 45d7981f..46803e5d 100644 --- a/privacy-toggles.js +++ b/privacy-toggles.js @@ -7,12 +7,12 @@ export default { based on the information stored in this cookie.`, default: true, }, - analytics: { + /* analytics: { title: 'Analytics', description: `Modrinth uses in-house tools that allows us to get insights on how each user is using the platform, to improve the experience for everyone.`, default: true, - }, + }, */ }, }