Simplify filter

pull/10616/head
Luke Morris 2018-02-20 11:26:43 -08:00
parent f89be6c653
commit 854427267f
1 changed files with 1 additions and 16 deletions

View File

@ -17,20 +17,5 @@ export const getAnnotations = (graph, annotations = []) => {
const [xStart, xEnd] = graph.xAxisRange()
return annotations.filter(a => {
const annoStart = +a.startTime
const annoEnd = +a.endTime
// If annotation is too far left
if (annoEnd < xStart) {
return false
}
// If annotation is too far right
if (annoStart > xEnd) {
return false
}
return true
})
return annotations.filter(a => +a.endTime >= xStart || +a.startTime <= xEnd)
}