Patch Build App
This commit is contained in:
1 parent
79842b8c44
commit
e42f6c01ec
3 files changed
+8
-35
No files matched your search
@@ -260,7 +260,7 @@ export default function ClassiquesArriveesQuais(){
|
||||
return result.size ? result : null;
|
||||
}, [parsePerturbArretsObject]);
|
||||
|
||||
const parseDelayMinutesFromArret = (arret) => {
|
||||
const parseDelayMinutesFromArret = useCallback((arret) => {
|
||||
if (!arret) return null;
|
||||
const keys = ['retard_minutes','retard','delay_minutes','delay','retard_min'];
|
||||
for (const k of keys) {
|
||||
@@ -269,7 +269,7 @@ export default function ClassiquesArriveesQuais(){
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}, []);
|
||||
|
||||
const buildPerturbMap = useCallback((list = []) => {
|
||||
const idx = { byHoraire: {}, byNumber: {}, byStopId: {}, byStopName: {}, global: [] };
|
||||
@@ -292,7 +292,7 @@ export default function ClassiquesArriveesQuais(){
|
||||
return idx;
|
||||
}, [normalizeName]);
|
||||
|
||||
const findPerturbsForHoraireAndStop = (horaire, stationId, stationName, idx) => {
|
||||
const findPerturbsForHoraireAndStop = useCallback((horaire, stationId, stationName, idx) => {
|
||||
const res = [];
|
||||
const map = idx || buildPerturbMap(perturbations || []);
|
||||
const hId = horaire && (horaire.id || horaire.horaire_id || horaire.numero || horaire.numero_train);
|
||||
@@ -312,7 +312,7 @@ export default function ClassiquesArriveesQuais(){
|
||||
} catch (e) {}
|
||||
}
|
||||
return Array.from(new Set(res));
|
||||
};
|
||||
}, [buildPerturbMap, perturbations, normalizeName]);
|
||||
|
||||
const computeStatusForHoraireAtStop = useCallback((horaire, stationId, stationName, idx, serviceDate = null) => {
|
||||
const found = findPerturbsForHoraireAndStop(horaire, stationId, stationName, idx) || [];
|
||||
|
||||
@@ -243,7 +243,7 @@ export default function ClassiquesDepartsQuais(){
|
||||
return result.size ? result : null;
|
||||
}, [parsePerturbArretsObject]);
|
||||
|
||||
const parseDelayMinutesFromArret = (arret) => {
|
||||
const parseDelayMinutesFromArret = useCallback((arret) => {
|
||||
if (!arret) return null;
|
||||
const keys = ['retard_minutes','retard','delay_minutes','delay','retard_min'];
|
||||
for (const k of keys) {
|
||||
@@ -252,7 +252,7 @@ export default function ClassiquesDepartsQuais(){
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}, []);
|
||||
|
||||
const buildPerturbMap = useCallback((list = []) => {
|
||||
const idx = { byHoraire: {}, byNumber: {}, byStopId: {}, byStopName: {}, global: [] };
|
||||
@@ -275,7 +275,7 @@ export default function ClassiquesDepartsQuais(){
|
||||
return idx;
|
||||
}, [normalizeName]);
|
||||
|
||||
const findPerturbsForHoraireAndStop = (horaire, stationId, stationName, idx) => {
|
||||
const findPerturbsForHoraireAndStop = useCallback((horaire, stationId, stationName, idx) => {
|
||||
const res = [];
|
||||
const map = idx || buildPerturbMap(perturbations || []);
|
||||
const hId = horaire && (horaire.id || horaire.horaire_id || horaire.numero || horaire.numero_train);
|
||||
@@ -295,7 +295,7 @@ export default function ClassiquesDepartsQuais(){
|
||||
} catch (e) {}
|
||||
}
|
||||
return Array.from(new Set(res));
|
||||
};
|
||||
}, [buildPerturbMap, perturbations, normalizeName]);
|
||||
|
||||
const computeStatusForHoraireAtStop = useCallback((horaire, stationId, stationName, idx, serviceDate = null) => {
|
||||
const found = findPerturbsForHoraireAndStop(horaire, stationId, stationName, idx) || [];
|
||||
|
||||
Reference in new issue
Block a user