Skip to content

Commit

Permalink
Sort routes by create_time.
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7B5 committed Jun 18, 2024
1 parent a3a4413 commit fe7a230
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/actions/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 2 additions & 0 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit fe7a230

Please sign in to comment.