Compare commits

..

No commits in common. "fdd3bc1f5a3fd4063e1d706a703e4685ee972266" and "bda565f8c95d67653ea8c2e7ccce8fcf413f7e28" have entirely different histories.

View file

@ -75,12 +75,9 @@ const movieSearch = () => {
filteredMovies.value = sortMovies(filtered);
}
const handleImageError = (_e: Event, movieId: number) => {
imageErrors.value = new Set(imageErrors.value).add(movieId);
}
const getPosterSrc = (movie: Movie) => {
return imageErrors.value.has(movie.id) ? posterPlaceholder : movie.poster;
const handleImageError = (e: Event, movieId: number) => {
(e.target as HTMLImageElement).src = posterPlaceholder;
imageErrors.value.add(movieId);
}
const isSortActive = (field: SortField, direction: SortDirection): boolean => {
@ -133,7 +130,7 @@ const isSortActive = (field: SortField, direction: SortDirection): boolean => {
<div class="movie-poster-container">
<NuxtImg
:class="{ 'movie-poster-error': imageErrors.has(movie.id) }"
:src="getPosterSrc(movie)"
:src="movie.poster"
alt=""
class="movie-poster"
loading="lazy"