You've already forked AstralRinth
forked from didirus/AstralRinth
Fix privacy settings not reflecting cookie values
This commit is contained in:
@@ -48,17 +48,23 @@ import scopes from '@/privacy-toggles'
|
|||||||
export default {
|
export default {
|
||||||
name: 'Privacy',
|
name: 'Privacy',
|
||||||
fetch() {
|
fetch() {
|
||||||
Object.keys(scopes.settings).forEach((key) => {
|
if (this.$cookies.get('modrinth-scopes') !== null) {
|
||||||
scopes.settings[key].value = scopes.settings[key].default
|
this.$store.dispatch('consent/loadFromCookies', this.$cookies)
|
||||||
})
|
|
||||||
|
|
||||||
this.$store.dispatch('consent/loadFromCookies', this.$cookies)
|
Object.keys(scopes.settings).forEach((key) => {
|
||||||
|
scopes.settings[key].value = false
|
||||||
|
})
|
||||||
|
|
||||||
// Load the allowed scopes from the store
|
// Load the allowed scopes from the store
|
||||||
this.$store.state.consent.scopes_allowed.forEach((scope) => {
|
this.$store.state.consent.scopes_allowed.forEach((scope) => {
|
||||||
if (this.scopes[scope] != null)
|
if (this.scopes[scope] != null)
|
||||||
this.$set(this.scopes[scope], 'value', true)
|
this.$set(this.scopes[scope], 'value', true)
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
Object.keys(scopes.settings).forEach((key) => {
|
||||||
|
scopes.settings[key].value = scopes.settings[key].default
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data: () => {
|
data: () => {
|
||||||
const settings = scopes.settings
|
const settings = scopes.settings
|
||||||
|
|||||||
Reference in New Issue
Block a user