diff --git a/src/devtools/index.js b/src/devtools/index.js index 3d764fbad..a8f06869d 100644 --- a/src/devtools/index.js +++ b/src/devtools/index.js @@ -147,7 +147,7 @@ function initApp (shell) { if (index === -1) { store.commit('vuex/UPDATE_BASE_STATE', snapshot) - } else if (store.state.vuex.inspectedIndex === index) { + } else if (store.getters['vuex/absoluteInspectedIndex'] === index) { store.commit('vuex/UPDATE_INSPECTED_STATE', snapshot) } diff --git a/src/devtools/views/vuex/module.js b/src/devtools/views/vuex/module.js index 5fb4995a5..1aef489ba 100644 --- a/src/devtools/views/vuex/module.js +++ b/src/devtools/views/vuex/module.js @@ -138,6 +138,14 @@ const getters = { filteredHistory ({ history, filterRegex }) { return history.filter(entry => filterRegex.test(entry.mutation.type)) + }, + + absoluteInspectedIndex ({ history, inspectedIndex }, { filteredHistory }) { + const entry = filteredHistory[inspectedIndex] + if (entry) { + return history.indexOf(entry) + } + return -1 } }