Remove analytics consent (#163)

* Remove analytics consent

* Use watch for cookie popup visibility

* Fix double scrollbar, delete account not centered
This commit is contained in:
Geometrically
2021-04-11 14:31:21 -07:00
committed by GitHub
parent cecafb726c
commit 28092d6862
5 changed files with 24 additions and 17 deletions

View File

@@ -25,21 +25,26 @@ import scopes from '~/privacy-toggles'
export default { export default {
name: 'CookieConsent', name: 'CookieConsent',
fetch() { fetch() {
// Get informations in the store this.checkVisibility()
this.$store.dispatch('consent/loadFromCookies', this.$cookies)
if (
!this.$store.state.consent.is_consent_given &&
this.$route.path !== '/dashboard/privacy'
) {
this.shown = true
}
}, },
data() { data() {
return { return {
shown: false, shown: false,
} }
}, },
watch: {
$route() {
this.checkVisibility()
},
},
methods: { methods: {
checkVisibility() {
this.$store.dispatch('consent/loadFromCookies', this.$cookies)
this.shown =
!this.$store.state.consent.is_consent_given &&
this.$route.path !== '/dashboard/privacy'
},
hide() { hide() {
this.$store.commit('consent/set_consent', true) this.$store.commit('consent/set_consent', true)
// Accept all scopes // Accept all scopes

View File

@@ -212,7 +212,6 @@ export default {
.layout { .layout {
background-color: var(--color-bg); background-color: var(--color-bg);
display: block; display: block;
height: 100vh;
.site-header { .site-header {
height: var(--size-navbar-height); height: var(--size-navbar-height);

View File

@@ -46,7 +46,7 @@ export default async function (ctx, inject) {
ctx.app.head.script.push(script); ctx.app.head.script.push(script);
} }
}; };
if (isAnalyticsOn(ctx)) { // if (isAnalyticsOn(ctx)) {
// Inject unami // Inject unami
const analyticsScript = { const analyticsScript = {
hid: UNAMI_LIB_TAG_ID, hid: UNAMI_LIB_TAG_ID,
@@ -56,9 +56,9 @@ export default async function (ctx, inject) {
defer: true, defer: true,
}; };
injectScript(analyticsScript); injectScript(analyticsScript);
} else { // } else {
// console.log("Analytics scope was denied.") // console.log("Analytics scope was denied.")
} // }
} }

View File

@@ -103,9 +103,12 @@
will be removed from our servers. This cannot be reversed, so be will be removed from our servers. This cannot be reversed, so be
careful!</span careful!</span
> >
<div type="button" class="button" @click="showPopup"> <input
Delete Account value="Delete Account"
</div> type="button"
class="button"
@click="showPopup"
/>
</label> </label>
</section> </section>
</div> </div>

View File

@@ -7,12 +7,12 @@ export default {
based on the information stored in this cookie.`, based on the information stored in this cookie.`,
default: true, default: true,
}, },
analytics: { /* analytics: {
title: 'Analytics', title: 'Analytics',
description: `Modrinth uses in-house tools that allows us to get insights on how 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 each user is using the platform, to improve the experience for
everyone.`, everyone.`,
default: true, default: true,
}, }, */
}, },
} }