Skip to content
Merged
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"node": ">=16"
},
"dependencies": {
"@commaai/api": "github:commaai/comma-api#3.1.3",
"@commaai/api": "github:commaai/comma-api#3.2.0",
"@commaai/my-comma-auth": "^1.4.1",
"@mapbox/mapbox-sdk": "^0.15.3",
"@material-ui/core": "^1.5.1",
Expand Down
11 changes: 6 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export function checkRoutesData() {
...r,
url: r.url.replace('chffrprivate.blob.core.windows.net', 'chffrprivate.azureedge.net'),
log_id: r.fullname.split('|')[1],
// TODO: backwards compatiblity, remove later
distance: r.distance || r.length,
duration: endTime - startTime,
start_time_utc_millis: startTime,
end_time_utc_millis: endTime,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dashboard/DriveListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ const DriveListItem = (props) => {
const duration = formatDriveDuration(drive.duration);

const distance = isMetric()
? `${+(drive.length * KM_PER_MI).toFixed(1)} km`
: `${+drive.length.toFixed(1)} mi`;
? `${+(drive.distance * KM_PER_MI).toFixed(1)} km`
: `${+drive.distance.toFixed(1)} mi`;

/* eslint-disable key-spacing, no-multi-spaces */
const gridStyle = small ? {
Expand Down
8 changes: 5 additions & 3 deletions src/components/Dashboard/DriveListItem.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ describe('drive list items', () => {
render(<DriveListItem
store={store}
drive={{
fullname: '1d3dc3e03047b0c7/000000dd--455f14369d',
dongle_id: '1d3dc3e03047b0c7',
log_id: '000000dd--455f14369d',
start_time_utc_millis: 1570830798378,
end_time_utc_millis: 1570830798378 + 1234,
length: 12.5212,
startCoord: [0, 0],
endCoord: [0, 0],
distance: 12.5212,
duration: 1234,
}}
/>);
expect(screen.getByRole('link')).toHaveClass('DriveEntry');
Expand Down