Added filter presets to consent warning. Updating scenes when tag filter changes.

This commit is contained in:
DebaucheryLibrarian
2021-01-04 01:30:39 +01:00
parent ab83a42dfb
commit 62ef041b35
8 changed files with 153 additions and 52 deletions

View File

@@ -3,7 +3,7 @@
<Warning
v-if="showWarning"
class="warning-container"
@enter="setConsent(true)"
@enter="(includeQueer) => setConsent(true, includeQueer)"
@leave="setConsent(false)"
/>
@@ -46,11 +46,18 @@ function toggleFilters(state) {
this.showSidebar = false;
}
async function setConsent(consent) {
async function setConsent(consent, includeQueer) {
if (consent) {
this.showWarning = false;
localStorage.setItem('consent', window.env.sessionId);
}
if (includeQueer) {
this.$store.dispatch('setTagFilter', this.$store.state.ui.tagFilter.filter(tag => !['gay', 'bisexual', 'transsexual'].includes(tag)));
return;
}
this.$store.dispatch('setTagFilter', this.$store.state.ui.tagFilter.concat(['gay', 'bisexual', 'transsexual']));
}
function blur(event) {