Skip to content

Commit

Permalink
Only add history state when it is different
Browse files Browse the repository at this point in the history
  • Loading branch information
villermen committed Jun 7, 2016
1 parent bfa4010 commit a3536bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/scripts/components/Sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Sample {

Player.instance.play(this.playerId, multiple, loop);

if (params.addToHistory) {
if (params.addToHistory && (history.state === null || history.state.id !== this.id)) {
history.pushState({ id: this.id }, '', this.id);
}
}
Expand Down

0 comments on commit a3536bf

Please sign in to comment.