Added various conditions to prevent errors and warnings.

This commit is contained in:
DebaucheryLibrarian 2021-03-04 02:35:43 +01:00
parent 0c98df232e
commit fa30fe5169
7 changed files with 37 additions and 14 deletions

View File

@ -363,6 +363,7 @@
<Pagination
:items-total="totalCount"
:items-per-page="limit"
name="actorRange"
class="pagination-top"
/>
</div>
@ -409,7 +410,7 @@ function showAlbum() {
}
async function watchRoute(to, from) {
if (to.hash !== '#album' && from.hash !== '#album') {
if ((to.name === 'actor' || to.name === 'actorRange') && to.hash !== '#album' && from.hash !== '#album') {
await this.fetchActor();
}
}

View File

@ -1,6 +1,9 @@
<template>
<div class="actors">
<nav class="filter">
<nav
ref="filter"
class="filter"
>
<ul class="genders nolist">
<li class="gender">
<router-link
@ -219,7 +222,7 @@
v-if="totalCount > 0"
:items-total="totalCount"
:items-per-page="limit"
class="pagination-top"
class="pagination-bottom"
/>
<Footer />
@ -241,7 +244,11 @@ const boobSizes = 'ABCDEFGHZ'.split('');
function updateFilters() {
this.$router.push({
name: 'actors',
params: this.$route.params,
params: {
pageNumber: 1,
gender: this.gender,
letter: this.letter,
},
query: {
nb: this.naturalBoobs !== 1 ? this.naturalBoobs : undefined,
bs: this.boobSizeRequired ? this.boobSize.join(',') : undefined,
@ -281,7 +288,7 @@ async function fetchActors(scroll) {
this.totalCount = totalCount;
if (scroll) {
this.$refs.pagination.$el.scrollIntoView();
this.$refs.filter?.scrollIntoView();
}
}

View File

@ -39,7 +39,7 @@ async function fetchReleases() {
this.totalCount = totalCount;
this.releases = releases;
this.$refs.filter.$el.scrollIntoView();
this.$refs.filter?.$el.scrollIntoView();
}
async function mounted() {

View File

@ -9,12 +9,12 @@
>
<router-link
class="pagination-button cursor"
:to="{ params: { pageNumber: 1 }, query: $route.query }"
:to="{ name, params: { ...params, pageNumber: 1 }, query: $route.query }"
><Icon icon="first2" /></router-link>
<router-link
class="pagination-button cursor"
:to="{ params: { pageNumber: pageNumber - 1 }, query: $route.query }"
:to="{ name, params: { ...params, pageNumber: pageNumber - 1 }, query: $route.query }"
><Icon icon="arrow-left" /></router-link>
</span>
@ -30,14 +30,14 @@
<router-link
v-for="pageX in pageNumber - 1"
:key="`page-${pageX}`"
:to="{ params: { pageNumber: pageNumber - pageX }, query: $route.query }"
:to="{ name, params: { ...params, pageNumber: pageNumber - pageX }, query: $route.query }"
class="pagination-button page"
> {{ pageNumber - pageX }} </router-link>
</span>
<router-link
:key="`page-${pageNumber}`"
:to="{ params: { pageNumber }, query: $route.query }"
:to="{ name, params: { ...params, pageNumber }, query: $route.query }"
class="pagination-button page active"
> {{ pageNumber }} </router-link>
@ -45,7 +45,7 @@
<router-link
v-for="pageX in (pageCount - pageNumber)"
:key="`page-${pageX + pageNumber}`"
:to="{ params: { pageNumber: pageX + pageNumber }, query: $route.query }"
:to="{ name, params: { ...params, pageNumber: pageX + pageNumber }, query: $route.query }"
class="pagination-button page"
> {{ pageX + pageNumber }} </router-link>
</span>
@ -56,12 +56,12 @@
>
<router-link
class="pagination-button cursor"
:to="{ params: { pageNumber: pageNumber + 1 }, query: $route.query }"
:to="{ name, params: { ...params, pageNumber: pageNumber + 1 }, query: $route.query }"
><Icon icon="arrow-right" /></router-link>
<router-link
class="pagination-button cursor"
:to="{ params: { pageNumber: pageCount }, query: $route.query }"
:to="{ name, params: { ...params, pageNumber: pageCount }, query: $route.query }"
><Icon icon="last2" /></router-link>
</span>
@ -100,6 +100,14 @@ export default {
type: Boolean,
default: true,
},
name: {
type: String,
default: null,
},
params: {
type: Object,
default: null,
},
},
computed: {
pageNumber,

View File

@ -167,6 +167,7 @@ export default {
default: null,
},
},
emits: ['load'],
data() {
return {
player: null,

View File

@ -218,7 +218,9 @@ async function fetchRelease() {
this.release = await this.$store.dispatch('fetchMovieById', this.$route.params.releaseId);
}
if (this.$refs.content) {
this.$refs.content.scrollTop = 0;
}
}
function bannerBackground() {

View File

@ -13,6 +13,10 @@ function initActorActions(store, router) {
pageNumber = 1,
range = 'latest',
}) {
if (!actorId) {
return null;
}
const { before, after, orderBy } = getDateRange(range);
const includedTags = router.currentRoute.value.query.tags ? router.currentRoute.value.query.tags.split(',') : [];
const mode = router.currentRoute.value.query.mode || 'all';