Fix issues with privacy settings

This commit is contained in:
Jai A
2021-04-10 21:54:16 -07:00
parent 03b2d02742
commit 7d3ad5a639
7 changed files with 40 additions and 23 deletions

View File

@@ -29,6 +29,10 @@
<SettingsIcon />
Settings
</nuxt-link>
<nuxt-link :to="'/dashboard/privacy'" class="tab last">
<SettingsIcon />
Privacy Settings
</nuxt-link>
</div>
<div v-else class="card page-nav">
<a :href="authUrl" class="tab last">

View File

@@ -47,20 +47,25 @@
import scopes from '@/privacy-toggles'
export default {
name: 'Privacy',
data: () => {
const settings = scopes.settings
return {
scopes: settings,
}
},
mounted() {
fetch() {
Object.keys(scopes.settings).forEach((key) => {
scopes.settings[key].value = scopes.settings[key].default
})
this.$store.dispatch('consent/loadFromCookies', this.$cookies)
// Load the allowed scopes from the store
this.$store.state.consent.scopes_allowed.forEach((scope) => {
if (this.scopes[scope] != null)
this.$set(this.scopes[scope], 'value', true)
})
},
data: () => {
const settings = scopes.settings
return {
scopes: settings,
}
},
options: {
auth: false,
},