report if state is idle

This commit is contained in:
Josh Harvey 2016-04-21 20:01:27 +03:00
parent 1a93d6ae02
commit 4b5b460d12
2 changed files with 5 additions and 4 deletions

View file

@ -52,7 +52,6 @@ function checkStuckScreen (deviceEvents) {
var sortedEvents = R.sortBy(R.compose(toInt10, R.prop('device_time')), R.map(jsonParse, deviceEvents))
var noRepeatEvents = R.dropRepeatsWith(sameState, sortedEvents)
var lastEvent = R.last(noRepeatEvents)
var IDLE_STATES = ['idle', 'dualIdle']
var STALE_STATE = 60 * 1000
if (!lastEvent) {
@ -60,7 +59,9 @@ function checkStuckScreen (deviceEvents) {
}
var state = lastEvent.note.state
if (R.contains(state, IDLE_STATES)) {
var isIdle = lastEvent.note.isIdle
if (isIdle) {
return []
}