Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { athena as Athena, billing as Billing, devices as Devices, drives as Dri
import MyCommaAuth from '@commaai/my-comma-auth';

import * as Types from './types';
import { resetPlayback, selectLoop } from '../timeline/playback';
import { selectLoop } from '../timeline/playback';
import {hasRoutesData } from '../timeline/segments';
import { getDeviceFromState, deviceVersionAtLeast, deviceIsOnline } from '../utils';
import { webrtcConnectionManager } from '../utils/webrtc';
Expand Down Expand Up @@ -163,7 +163,6 @@ export function urlForState(dongleId, log_id, start, end, prime) {
function updateTimeline(state, dispatch, log_id, start, end, allowPathChange) {
if (!state.loop || !state.loop.startTime || !state.loop.duration || state.loop.startTime < start
|| state.loop.startTime + state.loop.duration > end || state.loop.duration < end - start) {
dispatch(resetPlayback());
dispatch(selectLoop(start, end));
}

Expand Down
4 changes: 3 additions & 1 deletion src/actions/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const ACTION_STARTUP_DATA = 'ACTION_STARTUP_DATA';
// global state management
export const ACTION_SELECT_DEVICE = 'ACTION_SELECT_DEVICE';
export const ACTION_SELECT_TIME_FILTER = 'ACTION_SELECT_TIME_FILTER';
export const ACTION_UPDATE_ROUTE_LIMIT = 'ACTION_UPDATE_ROUTE_LIMIT'
export const ACTION_UPDATE_ROUTE_LIMIT = 'ACTION_UPDATE_ROUTE_LIMIT';
export const ACTION_UPDATE_DEVICES = 'ACTION_UPDATE_DEVICES';
export const ACTION_UPDATE_DEVICE = 'ACTION_UPDATE_DEVICE';
export const ACTION_UPDATE_ROUTE = 'ACTION_UPDATE_ROUTE';
Expand All @@ -26,9 +26,11 @@ export const ACTION_PRIME_SUBSCRIBE_INFO = 'ACTION_PRIME_SUBSCRIBE_INFO';
export const ACTION_SEEK = 'action_seek';
export const ACTION_PAUSE = 'action_pause';
export const ACTION_PLAY = 'action_play';
export const ACTION_PLAYBACK_SPEED = 'action_playback_speed';
export const ACTION_LOOP = 'action_loop';
export const ACTION_BUFFER_VIDEO = 'action_buffer_video';
export const ACTION_RESET = 'action_reset';
export const ACTION_HAS_AUDIO = 'action_has_audio';

// segments
export const ACTION_UPDATE_SEGMENT_RANGE = 'update_segment_range';
Expand Down
10 changes: 2 additions & 8 deletions src/components/DriveMap/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import raf from 'raf';
import ReactMapGL, { LinearInterpolator } from 'react-map-gl';

import { fetchDriveCoords } from '../../actions/cached';
import { currentOffset } from '../../timeline';
import { DEFAULT_LOCATION, MAPBOX_STYLE, MAPBOX_TOKEN } from '../../utils/geocode';

const INTERACTION_TIMEOUT = 5000;
Expand Down Expand Up @@ -46,7 +45,7 @@ class DriveMap extends Component {
}

componentDidUpdate(prevProps) {
const { dispatch, currentRoute, startTime } = this.props;
const { dispatch, currentRoute } = this.props;

const prevRoute = prevProps.currentRoute?.fullname || null;
const route = currentRoute?.fullname || null;
Expand All @@ -57,10 +56,6 @@ class DriveMap extends Component {
}
}

if (prevProps.startTime && prevProps.startTime !== startTime) {
this.shouldFlyTo = true;
}

if (currentRoute && prevProps.currentRoute && currentRoute.driveCoords
&& prevProps.currentRoute.driveCoords !== currentRoute.driveCoords) {
this.shouldFlyTo = false;
Expand Down Expand Up @@ -99,7 +94,7 @@ class DriveMap extends Component {
const markerSource = this.map && this.map.getMap().getSource('seekPoint');
if (markerSource) {
if (this.props.currentRoute && this.props.currentRoute.driveCoords) {
const pos = this.posAtOffset(currentOffset());
const pos = this.posAtOffset(this.props.offset);
if (pos && pos.some((coordinate, index) => coordinate != this.lastMapPos[index])) {
this.lastMapPos = pos;
markerSource.setData({
Expand Down Expand Up @@ -310,7 +305,6 @@ class DriveMap extends Component {
const stateToProps = Obstruction({
offset: 'offset',
currentRoute: 'currentRoute',
startTime: 'startTime',
});

export default connect(stateToProps)(DriveMap);
Loading
Loading