Skip to content

Commit

Permalink
fix mutation keyNav boundary conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 6, 2017
1 parent 469a084 commit 84098d4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/devtools/views/vuex/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ export function revert ({ commit, state }, entry) {
}

export function inspect ({ commit, state }, entryOrIndex) {
if (typeof entryOrIndex !== 'number') {
entryOrIndex = state.history.indexOf(entryOrIndex)
}
commit('INSPECT', entryOrIndex)
let index = typeof entryOrIndex === 'number'
? entryOrIndex
: state.history.indexOf(entryOrIndex)
if (index < -1) index = -1
if (index >= state.history.length) index = state.history.length - 1
commit('INSPECT', index)
}

export function timeTravelTo ({ state, commit }, entry) {
Expand Down

0 comments on commit 84098d4

Please sign in to comment.