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();
}
}