forked from DebaucheryLibrarian/traxxx
Added dark and SFW modes.
This commit is contained in:
@@ -31,6 +31,12 @@ function initTagsActions(store, _router) {
|
||||
thumbnail
|
||||
path
|
||||
comment
|
||||
sfw: sfwMedia {
|
||||
id
|
||||
thumbnail
|
||||
path
|
||||
comment
|
||||
}
|
||||
}
|
||||
}
|
||||
photos: tagsPhotos {
|
||||
@@ -39,6 +45,12 @@ function initTagsActions(store, _router) {
|
||||
thumbnail
|
||||
path
|
||||
comment
|
||||
sfw: sfwMedia {
|
||||
id
|
||||
thumbnail
|
||||
path
|
||||
comment
|
||||
}
|
||||
}
|
||||
}
|
||||
releases: releasesTags(
|
||||
@@ -81,7 +93,7 @@ function initTagsActions(store, _router) {
|
||||
exclude: store.state.ui.filter,
|
||||
});
|
||||
|
||||
return curateTag(tagBySlug);
|
||||
return curateTag(tagBySlug, store);
|
||||
}
|
||||
|
||||
async function fetchTags({ _commit }, {
|
||||
@@ -110,6 +122,9 @@ function initTagsActions(store, _router) {
|
||||
poster: tagsPosterByTagId {
|
||||
media {
|
||||
thumbnail
|
||||
sfw: sfwMedia {
|
||||
thumbnail
|
||||
}
|
||||
}
|
||||
}
|
||||
group {
|
||||
@@ -123,7 +138,7 @@ function initTagsActions(store, _router) {
|
||||
limit,
|
||||
});
|
||||
|
||||
return tags.map(tag => curateTag(tag));
|
||||
return tags.map(tag => curateTag(tag, store.state.ui.sfw));
|
||||
}
|
||||
|
||||
async function fetchTagReleases({ _commit }, tagId) {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// import { get } from '../api';
|
||||
|
||||
function initUiActions(_store, _router) {
|
||||
function setFilter({ commit }, filter) {
|
||||
commit('setFilter', filter);
|
||||
@@ -16,10 +14,22 @@ function initUiActions(_store, _router) {
|
||||
localStorage.setItem('batch', batch);
|
||||
}
|
||||
|
||||
function setTheme({ commit }, theme) {
|
||||
commit('setTheme', theme);
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
||||
async function setSfw({ commit }, sfw) {
|
||||
commit('setSfw', sfw);
|
||||
localStorage.setItem('sfw', sfw);
|
||||
}
|
||||
|
||||
return {
|
||||
setFilter,
|
||||
setRange,
|
||||
setBatch,
|
||||
setSfw,
|
||||
setTheme,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,18 @@ function setBatch(state, batch) {
|
||||
state.batch = batch;
|
||||
}
|
||||
|
||||
function setSfw(state, sfw) {
|
||||
state.sfw = sfw;
|
||||
}
|
||||
|
||||
function setTheme(state, theme) {
|
||||
state.theme = theme;
|
||||
}
|
||||
|
||||
export default {
|
||||
setFilter,
|
||||
setRange,
|
||||
setBatch,
|
||||
setSfw,
|
||||
setTheme,
|
||||
};
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
const storedFilter = localStorage.getItem('filter');
|
||||
const storedRange = localStorage.getItem('range');
|
||||
const storedBatch = localStorage.getItem('batch');
|
||||
const storedSfw = localStorage.getItem('sfw');
|
||||
const storedTheme = localStorage.getItem('theme');
|
||||
|
||||
export default {
|
||||
filter: storedFilter ? storedFilter.split(',') : ['gay', 'transsexual'],
|
||||
range: storedRange || 'latest',
|
||||
batch: storedBatch || 'all',
|
||||
sfw: storedSfw === 'true' || false,
|
||||
theme: storedTheme || 'light',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user