Skip to content

Commit

Permalink
fixed logical error
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalkrishnads committed Jul 7, 2024
1 parent 6e57314 commit 044ae18
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export function checkRoutesData() {
return;
}

if (!state.currentRoute && state.segmentRange) {
// fix for drives outside date range not loading. checks whether the route in the url exists and if not, gets it from the staging API.
if (state.segmentRange && !routesData.some(route => route.log_id === state.segmentRange?.log_id)) {
await fetch(`https://api.aks.comma.ai/v1/devices/${dongleId}/routes_segments?route_str=${`${dongleId}|${state.segmentRange.log_id}`.replace(/%7C/g, '|')}`, {
headers: { 'Authorization': `JWT ${await getCommaAccessToken()}` }
})
Expand Down

0 comments on commit 044ae18

Please sign in to comment.