Skip to content

Commit

Permalink
Merge pull request nukeop#263 from charjac/fix.playnow
Browse files Browse the repository at this point in the history
fix play now issue
  • Loading branch information
nukeop authored Feb 12, 2019
2 parents 1ca0d76 + 7737bdf commit 81d2d3f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/containers/SoundContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,18 @@ class SoundContainer extends React.Component {
}

shouldComponentUpdate (nextProps) {
const currentSong = nextProps.queue.queueItems[nextProps.queue.currentSong];

return (
this.props.queue.currentSong !== nextProps.queue.currentSong ||
this.props.player.playbackStatus !== nextProps.player.playbackStatus ||
this.props.player.seek !== nextProps.player.seek
this.props.player.seek !== nextProps.player.seek ||
(!!currentSong && !!currentSong.streams && currentSong.streams.length > 0)
);
}

render () {
let { player, queue, plugins } = this.props;

let streamUrl = '';

if (queue.queueItems.length > 0) {
Expand All @@ -152,7 +154,7 @@ class SoundContainer extends React.Component {
).stream;
}

return (
return !!streamUrl && (
<Sound
url={streamUrl}
playStatus={player.playbackStatus}
Expand Down

0 comments on commit 81d2d3f

Please sign in to comment.