Skip to content

Commit

Permalink
no need to decodeURI in history implemenations
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 4, 2016
1 parent be368d8 commit 5df14c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/history/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class HashHistory {
const query = location.search && path.indexOf('?') > -1
? '&' + location.search.slice(1)
: location.search
self.onChange(decodeURI(path.replace(/^#!?/, '') + query))
self.onChange(path.replace(/^#!?/, '') + query)
}
window.addEventListener('hashchange', this.listener)
this.listener()
Expand Down
2 changes: 1 addition & 1 deletion src/history/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class HTML5History {

start () {
this.listener = (e) => {
let url = decodeURI(location.pathname + location.search)
let url = location.pathname + location.search
if (this.root) {
url = url.replace(this.rootRE, '')
}
Expand Down

0 comments on commit 5df14c6

Please sign in to comment.