Using generic session ID variable for to determine consent warning, rather than dedicated property.
This commit is contained in:
@@ -45,7 +45,7 @@ function toggleSidebar(state) {
|
||||
async function setConsent(consent) {
|
||||
if (consent) {
|
||||
this.showWarning = false;
|
||||
await this.$store.dispatch('setConsent', true);
|
||||
localStorage.setItem('consent', window.env.sessionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
showSidebar: false,
|
||||
showWarning: !window.env.consent,
|
||||
showWarning: localStorage.getItem('consent') !== window.env.sessionId,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { graphql, post } from '../api';
|
||||
import { graphql } from '../api';
|
||||
import { curateRelease, curateActor } from '../curate';
|
||||
|
||||
function initUiActions(_store, _router) {
|
||||
@@ -26,12 +26,6 @@ function initUiActions(_store, _router) {
|
||||
localStorage.setItem('sfw', sfw);
|
||||
}
|
||||
|
||||
async function setConsent({ _commit }, consent) {
|
||||
const res = await post('/consent', consent);
|
||||
|
||||
return res.ok;
|
||||
}
|
||||
|
||||
async function search({ _commit }, { query, limit = 20 }) {
|
||||
const res = await graphql(`
|
||||
query SearchReleases(
|
||||
@@ -194,7 +188,6 @@ function initUiActions(_store, _router) {
|
||||
setRange,
|
||||
setBatch,
|
||||
setSfw,
|
||||
setConsent,
|
||||
setTheme,
|
||||
fetchStats,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user