mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
Fixed: Artist and Album Posters show placeholder instead of image (#292)
* Fixed issue where after AlbumPoster had error state, non-errored images would be stuck with placeholder. * Fixed the poster loading issue for artists as well. * Updated ArtistBanner as well. * fixup: banner issues from previous missed update * fixup! remove lazy variable, fix variable
This commit is contained in:
@@ -58,16 +58,23 @@ class AlbumCover extends Component {
|
||||
pixelRatio
|
||||
} = this.state;
|
||||
|
||||
const nextcover = findCover(images);
|
||||
const nextCover = findCover(images);
|
||||
|
||||
if (nextcover && (!cover || nextcover.url !== cover.url)) {
|
||||
if (nextCover && (!cover || nextCover.url !== cover.url)) {
|
||||
this.setState({
|
||||
cover: nextcover,
|
||||
coverUrl: getCoverUrl(nextcover, pixelRatio * size),
|
||||
hasError: false
|
||||
// Don't reset isLoaded, as we want to immediately try to
|
||||
// show the new image, whether an image was shown previously
|
||||
// or the placeholder was shown.
|
||||
cover: nextCover,
|
||||
coverUrl: getCoverUrl(nextCover, pixelRatio * size),
|
||||
hasError: false,
|
||||
isLoaded: true
|
||||
});
|
||||
}
|
||||
|
||||
// The cover could not be loaded..
|
||||
if (!nextCover && (this.props !== prevProps)) {
|
||||
this.setState({
|
||||
cover: undefined,
|
||||
coverUrl: coverPlaceholder,
|
||||
hasError: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user