Make selecting tempVar func better

pull/1326/head
Andrew Watkins 2017-04-24 14:42:10 -07:00
parent 96004a71fc
commit f46602f983
1 changed files with 2 additions and 4 deletions

View File

@ -101,16 +101,14 @@ class RawQueryEditor extends Component {
if (i >= 0) {
if (direction === 'next') {
if (i === lastIndex) {
return templates[0]
}
return templates[i + 1]
return templates[(i + 1) % templates.length]
}
if (direction === 'previous') {
if (i === 0) {
return templates[lastIndex]
}
return templates[i - 1]
}
}