Skip to content

Commit aa94144

Browse files
Guillaume Chauiksim
Guillaume Chau
authored and
iksim
committed
fix(vuex): reset snapshot cache when page reloads, closes vuejs#940
1 parent 7769439 commit aa94144

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/devtools/views/vuex/VuexStateInspector.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,13 @@ export default {
202202
if (this.isOnlyMutationPayload && this.$shared.vuexAutoload) {
203203
this.loadState()
204204
}
205+
206+
bridge.on('vuex:init', this.onVuexInit)
205207
},
206208
207209
destroyed () {
208210
bridge.off('vuex:mutation', this.onMutation)
211+
bridge.off('vuex:init', this.onVuexInit)
209212
},
210213
211214
methods: {
@@ -258,7 +261,13 @@ export default {
258261
if (this.$shared.vuexAutoload) {
259262
this.loadState()
260263
}
261-
}, 800)
264+
}, 800),
265+
266+
onVuexInit () {
267+
if (this.$shared.vuexAutoload) {
268+
this.loadState()
269+
}
270+
}
262271
}
263272
}
264273

src/devtools/views/vuex/module.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const state = {
2626
const mutations = {
2727
'INIT' (state) {
2828
state.hasVuex = true
29+
snapshotsCache.reset()
2930
reset(state)
3031
},
3132

0 commit comments

Comments
 (0)