Skip to content

Commit

Permalink
replace legacy parse function with the newly created jsonToStringArray
Browse files Browse the repository at this point in the history
  • Loading branch information
Falsal committed Feb 26, 2024
1 parent d7333a8 commit d262d2d
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions src/components/TimeLine/ItineraryTourTimeLineContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Accordion,
AccordionDetails,
AccordionSummary,
Button,
// Button,
Divider,
Typography,
} from "@mui/material";
Expand Down Expand Up @@ -48,7 +48,9 @@ export default function ItineraryTourTimeLineContainer({

// after the useEffect we have state "entries" being a strings array representing the connection details
useEffect(() => {
let settingEnt = parseTourConnectionDescription(getSingleConnection());
// let settingEnt = parseTourConnectionDescription(getSingleConnection());
let settingEnt = jsonToStringArray(getSingleConnection(), "to");
consoleLog("L57 ITTLC/ useEffect settingEnt", settingEnt, true);
setEntries(settingEnt);
setReturnEntries(connections.returns);
extractReturns();
Expand Down Expand Up @@ -96,7 +98,15 @@ export default function ItineraryTourTimeLineContainer({
array[index],
"from"
);
consoleLog("L98 ITTLC/ extractReturns twoReturns", twoReturns, true);
consoleLog("L98 ITTLC/ extractReturns twoReturns[index]", twoReturns[index], true);
}

if (index > 1) {
remainingReturns[index] = jsonToStringArray(
array[index],
"from"
);
consoleLog("L120 ITTLC/ extractReturns remainingReturns[index]", remainingReturns[index], true);
}
// if (index <= 1) {
// twoReturns[index] = parseTourConnectionDescription(
Expand All @@ -106,12 +116,12 @@ export default function ItineraryTourTimeLineContainer({
// consoleLog("L98 ITTLC/ extractReturns twoReturns", twoReturns, true);
// }
//when index is > 1 -> fill array remainingReturns
if (index > 1) {
remainingReturns[index] = parseTourConnectionDescription(
array[index],
"return_description_detail"
);
}
// if (index > 1) {
// remainingReturns[index] = parseTourConnectionDescription(
// array[index],
// "return_description_detail"
// );
// }
}
return;
}
Expand Down Expand Up @@ -144,7 +154,7 @@ export default function ItineraryTourTimeLineContainer({
if (!!!connection) {
return <Fragment></Fragment>;
}
if (connection.connection_duration_minutes == 0) {
if (connection.connection_duration_minutes === 0) {
return t("details.start_ausgangort");
} else {
return t("Details.beste_anreise_kurz");
Expand Down

0 comments on commit d262d2d

Please sign in to comment.