File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,11 @@ export function createWorkoutSegment () {
1919 }
2020
2121 function setStart ( baseMetrics ) {
22- _startTime = baseMetrics . totalMovingTime
23- _startDistance = baseMetrics . totalLinearDistance
22+ _startTime = ( baseMetrics . totalMovingTime !== undefined && baseMetrics . totalMovingTime > 0 ? baseMetrics . totalMovingTime : 0 )
23+ _startDistance = ( baseMetrics . totalLinearDistance !== undefined && baseMetrics . totalLinearDistance > 0 ? baseMetrics . totalLinearDistance : 0 )
2424 _type = 'justrow'
25+ _targetTime = 0
26+ _targetDistance = 0
2527 _endTime = 0
2628 _endDistance = 0
2729 _split = {
@@ -135,7 +137,7 @@ export function createWorkoutSegment () {
135137
136138 // Checks for reaching a boundary condition
137139 function isEndReached ( baseMetrics ) {
138- if ( ( _endDistance > 0 && baseMetrics . totalLinearDistance >= _endDistance ) || ( _endTime > 0 && baseMetrics . totalMovingTime >= _endTime ) ) {
140+ if ( ( _type === 'distance' && _endDistance > 0 && baseMetrics . totalLinearDistance >= _endDistance ) || ( _type === 'time' && _endTime > 0 && baseMetrics . totalMovingTime >= _endTime ) ) {
139141 // We have exceeded the boundary
140142 return true
141143 } else {
You can’t perform that action at this time.
0 commit comments