Skip to content

Commit 116ded5

Browse files
author
Guillaume Chau
committed
feat(vuex): keep inspected mutation selected when receiving other unless it was the last one, closes vuejs#925
1 parent b3207e7 commit 116ded5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/devtools/views/vuex/module.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@ const mutations = {
3131
},
3232

3333
'RECEIVE_MUTATION' (state, entry) {
34+
const inspectingLastMutation = state.inspectedIndex === state.history.length - 1
3435
entry.id = uid++
3536
state.history.push(entry)
3637
if (!state.filter) {
37-
state.inspectedIndex = state.activeIndex = state.history.length - 1
38-
state.inspectedState = null
38+
state.activeIndex = state.history.length - 1
39+
if (inspectingLastMutation) {
40+
state.inspectedIndex = state.activeIndex
41+
state.inspectedState = null
42+
}
3943
}
4044
},
4145

0 commit comments

Comments
 (0)