Skip to content

Commit

Permalink
fix(urlsync): use history.replace instead of history.push
Browse files Browse the repository at this point in the history
BREAKING CHANGE: use history.replace instead of history.push
  • Loading branch information
imcuttle committed Jun 12, 2018
1 parent 8550d7e commit 77541f3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/decorator/urlSync/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,21 @@ export default getStateLifeDecorator({
/*exit(self, property, name) {
delete collection[name]
},*/
saveFirstTime(key, value, data) {
assertHistory()
useHistory.replace({
...data,
search: stringify({ ...data.query, [key]: value }),
query: null
})
},
// saveFirstTime(key, value, data) {
// assertHistory()
// useHistory.replace({
// ...data,
// search: stringify({ ...data.query, [key]: value }),
// query: null
// })
// },
save(key, value, data) {
assertHistory()
if (value && value.toJSON && typeof value.toJSON === 'function') {
value = value.toJSON()
}

useHistory.push({
useHistory.replace({
...data,
search: stringify({ ...data.query, [key]: value }),
query: null
Expand Down

0 comments on commit 77541f3

Please sign in to comment.