Skip to content

Commit 39b21be

Browse files
author
Guillaume Chau
committed
fix(vuex): issue when state snapshot already existed
1 parent 111a5e2 commit 39b21be

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/vuex.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function initVuexBackend (hook, bridge, isLegacy) {
4141
resetSnapshotCache()
4242
}
4343

44-
function resetSnapshotCache (force = true) {
44+
function resetSnapshotCache () {
4545
stateSnapshots = [
4646
{ index: -1, state: baseStateSnapshot }
4747
]
@@ -225,6 +225,10 @@ export function initVuexBackend (hook, bridge, isLegacy) {
225225
// Snapshot was already replayed
226226
if (stateSnapshot.index === index) {
227227
resultState = stateSnapshot.state
228+
229+
const state = parse(stateSnapshot.state, true)
230+
updateSnapshotsVm(state)
231+
store.replaceState(state)
228232
} else {
229233
const startMutation = mutations[stateSnapshot.index]
230234
if (startMutation) {

0 commit comments

Comments
 (0)