From 044ae1887d8d3f4b78850dd484625d000fb4a0f5 Mon Sep 17 00:00:00 2001 From: vishalkrishnads <321vishalds@gmail.com> Date: Sun, 7 Jul 2024 07:11:14 +0530 Subject: [PATCH] fixed logical error --- src/actions/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/actions/index.js b/src/actions/index.js index 2ace7243..18067526 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -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()}` } })