Skip to content

Commit

Permalink
Preserve history state when updating hash
Browse files Browse the repository at this point in the history
Current implementation replaces history state on every moveend with empty string.

The purposed solution replaces state with current state instead of empty string. The reason for this is to let other code to use history state as it is usual for single page applications.
  • Loading branch information
jirik authored and jfirebaugh committed Feb 13, 2018
1 parent ba032e5 commit a126d9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Hash {

_updateHashUnthrottled() {
const hash = this.getHashString();
window.history.replaceState('', '', hash);
window.history.replaceState(window.history.state, '', hash);
}

}
Expand Down

0 comments on commit a126d9e

Please sign in to comment.