fix(webui): better image loading for cards

only display the placeholder in case of error
don't display the placeholder for the thumbnails explorer
This commit is contained in:
Gauthier Roebroeck 2021-08-24 22:32:28 +08:00
parent 24a6406ed6
commit f0476ab890
3 changed files with 8 additions and 6 deletions

View file

@ -10,7 +10,7 @@
<!-- Thumbnail-->
<v-img
:src="thumbnailUrl"
lazy-src="../assets/cover.svg"
:lazy-src="thumbnailError ? coverBase64 : undefined"
aspect-ratio="0.7071"
contain
@error="thumbnailError = true"
@ -131,6 +131,7 @@ import {BookDto} from '@/types/komga-books'
import {SeriesDto} from '@/types/komga-series'
import {THUMBNAILBOOK_ADDED, THUMBNAILSERIES_ADDED} from '@/types/events'
import {ThumbnailBookSseDto, ThumbnailSeriesSseDto} from '@/types/komga-sse'
import {coverBase64} from '@/types/image'
export default Vue.extend({
name: 'ItemCard',
@ -189,6 +190,7 @@ export default Vue.extend({
actionMenuState: false,
thumbnailError: false,
thumbnailCacheBust: '',
coverBase64,
}
},
created() {

View file

@ -21,11 +21,10 @@
>
<v-img
:src="url"
lazy-src="../../assets/cover.svg"
aspect-ratio="0.7071"
:contain="true"
max-height="200"
max-width="140"
contain
height="200"
width="140"
class="ma-2"
@click="input = false; goTo(((page - 1 ) * perPage + i + 1))"
style="cursor: pointer"
@ -42,7 +41,7 @@
<script lang="ts">
import Vue from 'vue'
import { bookPageThumbnailUrl } from '@/functions/urls'
import {bookPageThumbnailUrl} from '@/functions/urls'
export default Vue.extend({
name: 'ThumbnailExplorerDialog',

File diff suppressed because one or more lines are too long