Fixing parallax state
This commit is contained in:
@ -24,7 +24,7 @@ export default class Parallax extends React.Component {
|
||||
componentDidUpdate = () => {
|
||||
const { image } = this.props;
|
||||
const { url } = this.state;
|
||||
if (image !== url) this.loadImage(image);
|
||||
if (image && image !== url) this.loadImage(image);
|
||||
}
|
||||
|
||||
loadImage(url) {
|
||||
@ -58,6 +58,7 @@ export default class Parallax extends React.Component {
|
||||
const {
|
||||
blur,
|
||||
fixedHeight,
|
||||
image,
|
||||
animate = true,
|
||||
} = this.props;
|
||||
const {
|
||||
|
||||
@ -48,20 +48,11 @@ class DiscoverNewReleases extends React.Component {
|
||||
this.props.uiActions.showContextMenu(data);
|
||||
}
|
||||
|
||||
renderIntro(album = null) {
|
||||
if (album) {
|
||||
return (
|
||||
<div className="intro preserve-3d">
|
||||
<Parallax image={album.images ? album.images.large : null} blur />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="intro preserve-3d">
|
||||
<Parallax />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
renderIntro = ({ images: { large } = {} } = {}) => (
|
||||
<div className="intro preserve-3d">
|
||||
<Parallax image={large} blur />
|
||||
</div>
|
||||
);
|
||||
|
||||
render() {
|
||||
if (isLoading(this.props.load_queue, ['spotify_browse/new-releases'])) {
|
||||
|
||||
Reference in New Issue
Block a user