Skip to content

Commit

Permalink
toggleHowler: don't mute if the prop has not changed (thangngoc89#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
svlapin authored and Stenerson committed Jun 30, 2018
1 parent 1cdac8e commit bf207f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ReactHowler.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 69,12 @@ class ReactHowler extends Component {

toggleHowler (props) {
(props.playing) ? this.play() : this.pause()
this.mute(props.mute)
this.loop(props.loop)

if (props.mute !== this.props.mute) {
this.mute(props.mute)
}

if (props.volume !== this.props.volume) {
this.volume(props.volume)
}
Expand Down

0 comments on commit bf207f1

Please sign in to comment.