Skip to content

Commit 6de894a

Browse files
committed
fix: Pushing state for empty qs
1 parent 8974eef commit 6de894a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/VuexURLSearchParams.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ class VuexURLSearchParams {
111111

112112
if (! _.isEmpty(qs)) {
113113
window.history.pushState(qs, null, `?${qs}`)
114+
} else {
115+
const { origin, pathname } = window.location
116+
window.history.pushState(null, null, origin + pathname)
114117
}
115118
}
116119

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuex-url-search-params",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Persist and rehydrate your Vuex store via url search params (window.location.search)",
55
"files": [
66
"build",

0 commit comments

Comments
 (0)