-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
In the Audio component: (this is written from head so maybe not exactly what already exists)
audioTimeout = null
componentWillMount() {
const { fetchCurrentTrack } = this.props
fetchCurrentTrack() // should be the first call of this action
}
componentWillReceiveProps(nextProps) {
const { currentTrack, fetchCurrentTrack } = nextProps
if (currentTrack.id !== this.props.currentTrack.id) {
this.audioTimeout = setTimeout(() => fetchCurrentTrack(), currentTrack.duration)
}
}
componentWillUnmount() {
clearTimeout(this.audioTimeout) // stop memory leaks
}
This process should allow only the current track to be displayed
Metadata
Metadata
Assignees
Labels
No labels