Fixed: Invalid image URL if Author/Book is missing background image

(cherry picked from commit dd096e0fda71b3afa9b09c2900abbf226d8a5204)

Closes #2625
This commit is contained in:
Bogdan 2023-06-27 01:23:18 +03:00
parent 1ebdffcd26
commit 07451cbcde
2 changed files with 12 additions and 6 deletions

View file

@ -92,6 +92,7 @@ class AuthorDetailsHeader extends Component {
titleWidth
} = this.state;
const fanartUrl = getFanartUrl(images);
const marqueeWidth = titleWidth - (isSmallScreen ? 85 : 160);
const continuing = status === 'continuing';
@ -108,9 +109,11 @@ class AuthorDetailsHeader extends Component {
<div className={styles.header} style={{ width }} >
<div
className={styles.backdrop}
style={{
backgroundImage: `url(${getFanartUrl(images)})`
}}
style={
fanartUrl ?
{ backgroundImage: `url(${fanartUrl})` } :
null
}
>
<div className={styles.backdropOverlay} />
</div>

View file

@ -83,15 +83,18 @@ class BookDetailsHeader extends Component {
titleWidth
} = this.state;
const fanartUrl = getFanartUrl(author.images);
const marqueeWidth = titleWidth - (isSmallScreen ? 85 : 160);
return (
<div className={styles.header} style={{ width }}>
<div
className={styles.backdrop}
style={{
backgroundImage: `url(${getFanartUrl(author.images)})`
}}
style={
fanartUrl ?
{ backgroundImage: `url(${fanartUrl})` } :
null
}
>
<div className={styles.backdropOverlay} />
</div>