This commit is contained in:
Artem Anufrij
2023-02-08 12:37:55 +01:00
commit 3af8005786
152 changed files with 37333 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
export default {
collection(state) {
return state.collection;
},
favourites(state, getters, rootState, rootGetters) {
return state.collection.filter(f => rootGetters["user/favourites"].map(m => m.itemId).indexOf(f._id) > -1);
},
prevBox(state) {
let currentIndex = state.collection.indexOf(state.selectedBox);
let prevBox = {};
if (currentIndex > 0) {
prevBox = state.collection[currentIndex - 1];
}
return prevBox;
},
nextBox(state) {
let currentIndex = state.collection.indexOf(state.selectedBox);
let nextBox = {};
if (state.collection.length > currentIndex + 1) {
nextBox = state.collection[currentIndex + 1];
}
return nextBox;
},
selectedBox(state) {
return state.selectedBox;
},
loading(state) {
return state.loading;
},
eos(state) {
return state.eos;
},
newest(state) {
return state.newest;
}
}