提交 8167e3c8 编写于 作者: G Guillaume Chau

fix(vuex): inspect state not working when history is filtered

上级 118a37f3
......@@ -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)
}
......
......@@ -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
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册