Skip to content

Commit

Permalink
Old url redirect working.
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7B5 committed Jun 4, 2024
1 parent 4ddfddb commit 50c3652
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/actions/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ export const onHistoryMiddleware = ({ dispatch, getState }) => (next) => (action
const pathZoom = getZoom(action.payload.location.pathname);

if (pathZoom !== state.zoom) {
// const { start, end } = pathZoom;

// Drives.getRoutesSegments(pathDongleId, start, end).then((routesData) => {
// if (routesData && routesData.length > 0) {
// const logId = routesData[0].fullname.split('|')[1];
// const duration = routesData[0].end_time_utc_millis - routesData[0].start_time_utc_millis;

// dispatch(pushTimelineRange(logId, 0, duration, true))
// }
// }).catch((err) => {
// console.error('Error fetching routes data for log ID conversion', err);
// });
const { start, end } = pathZoom;

Drives.getRoutesSegments(pathDongleId, start, end).then((routesData) => {
if (routesData && routesData.length > 0) {
const logId = routesData[0].fullname.split('|')[1];
const duration = routesData[0].end_time_utc_millis - routesData[0].start_time_utc_millis;

dispatch(pushTimelineRange(logId, 0, duration, true))
}
}).catch((err) => {
console.error('Error fetching routes data for log ID conversion', err);
});
}

const pathSegmentRange = getSegmentRange(action.payload.location.pathname);
Expand Down

0 comments on commit 50c3652

Please sign in to comment.