From fe7a23071ffa8aa45318d10ea0c72aebcde39747 Mon Sep 17 00:00:00 2001 From: 0x7B5 Date: Tue, 18 Jun 2024 00:50:08 -0400 Subject: [PATCH] Sort routes by create_time. --- src/actions/history.js | 1 - src/actions/index.js | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/actions/history.js b/src/actions/history.js index 6a86f2a1..b139baa1 100644 --- a/src/actions/history.js +++ b/src/actions/history.js @@ -24,7 +24,6 @@ export const onHistoryMiddleware = ({ dispatch, getState }) => (next) => async ( if ((pathZoom !== state.zoom) && pathZoom && !pathSegmentRange) { const [start, end] = [pathZoom.start, pathZoom.end]; - console.log('Fetching routes data for log ID conversion', pathDongleId, start, end); Drives.getRoutesSegments(pathDongleId, start, end).then((routesData) => { if (routesData && routesData.length > 0) { const log_id = routesData[0].fullname.split('|')[1]; diff --git a/src/actions/index.js b/src/actions/index.js index efda176c..da09ecb2 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -73,6 +73,8 @@ export function checkRoutesData() { // TODO: get this from the API, this isn't correct for segments with a time jump segment_durations: r.segment_start_times.map((x, i) => r.segment_end_times[i] - x), }; + }).sort((a, b) => { + return b.create_time - a.create_time; }); dispatch({