fix check to render a dot or bar in timeline

This commit is contained in:
Lachlan Kermode
2020-10-26 11:13:57 +01:00
parent ddbee03f50
commit 411c39a209
2 changed files with 4 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ import DatetimeBar from './DatetimeBar'
import DatetimeSquare from './DatetimeSquare'
import DatetimeStar from './DatetimeStar'
import Project from './Project'
import { calcOpacity, getEventCategories } from '../../../common/utilities'
import { calcOpacity, getEventCategories, isLatitude, isLongitude } from '../../../common/utilities'
function renderDot (event, styles, props) {
return <DatetimeDot
@@ -82,7 +82,7 @@ const TimelineEvents = ({
return null
}
}
const isDot = (!!event.location && !!event.longitude) || (features.GRAPH_NONLOCATED && event.projectOffset !== -1)
const isDot = (isLatitude(event.latitude) && isLongitude(event.longitude)) || (features.GRAPH_NONLOCATED && event.projectOffset !== -1)
let renderShape = isDot ? renderDot : renderBar
if (event.shape) {

View File

@@ -1,6 +1,6 @@
import React from 'react'
import colors from '../../../common/global'
import { getEventCategories } from '../../../common/utilities'
import { getEventCategories, isLatitude, isLongitude } from '../../../common/utilities'
const TimelineMarkers = ({
styles,
@@ -51,7 +51,7 @@ const TimelineMarkers = ({
/>
}
const isDot = (!!event.location && !!event.longitude) || (features.GRAPH_NONLOCATED && event.projectOffset !== -1)
const isDot = (isLatitude(event.latitude) && isLongitude(event.longitude)) || (features.GRAPH_NONLOCATED && event.projectOffset !== -1)
const evShadows = getEventCategories(event, categories).map(cat => getEventY({ ...event, category: cat.id }))
function renderMarkerForEvent (y) {