Patch Build App
This commit is contained in:
1 parent
3fcdf7e5ef
commit
b5df269cf8
5 files changed
+40
-30
No files matched your search
@@ -416,7 +416,7 @@ export default function ClassiquesDeparts(){
|
||||
|
||||
if (maxDelay != null) return { label: `retardé +${maxDelay}min.`, detail: '', delayMinutes: maxDelay };
|
||||
return { label: "à l'heure", detail: '', delayMinutes: null };
|
||||
}, [findPerturbsForHoraireAndStop, parsePerturbArretsObject, getPerturbationJours, parseDelayMinutesFromArret, normalizeName]);
|
||||
}, [findPerturbsForHoraireAndStop, parsePerturbArretsObject, getPerturbationJours, parseDelayMinutesFromArret, normalizeName, debug]);
|
||||
|
||||
// Applique les perturbations à une liste d'horaires : calcule status par arrêt et met à jour l'heure affichée
|
||||
const applyPerturbationsToHoraires = useCallback((list = [], perturbList = perturbations, displayStationId = null, displayStationName = null, serviceDate = null) => {
|
||||
@@ -471,7 +471,7 @@ export default function ClassiquesDeparts(){
|
||||
horaire._displayPlatform = (stopForStation && (stopForStation.quai || stopForStation.platform || stopForStation.quay)) || horaire.platform || '';
|
||||
return horaire;
|
||||
});
|
||||
}, [buildPerturbMap, computeStatusForHoraireAtStop, formatTimeFromHM, perturbations, gareDisplay, gareIdParam, getStops, normalizeName, debug]);
|
||||
}, [buildPerturbMap, computeStatusForHoraireAtStop, formatTimeFromHM, perturbations, gareDisplay, gareIdParam, getStops, normalizeName]);
|
||||
|
||||
useEffect(() => {
|
||||
const id = setInterval(() => setShowStatus(s => !s), 3000);
|
||||
@@ -915,7 +915,7 @@ export default function ClassiquesDeparts(){
|
||||
const intervalId = setInterval(fetchData, intervalMs);
|
||||
|
||||
return () => { mounted = false; clearInterval(intervalId); };
|
||||
}, [gareDisplay, gareIdParam, buildPerturbMap, computeStatusForHoraireAtStop, findPerturbsForHoraireAndStop, normalizeName, formatTimeFromHM, applyPerturbationsToHoraires, debug, getStops]);
|
||||
}, [gareDisplay, gareIdParam, buildPerturbMap, computeStatusForHoraireAtStop, findPerturbsForHoraireAndStop, normalizeName, formatTimeFromHM, applyPerturbationsToHoraires, debug, getStops, getPerturbationJours]);
|
||||
|
||||
// Helpers pour perturbations (memoized plus haut)
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ export default function ClassiquesArriveesQuais(){
|
||||
} catch (e) { return []; }
|
||||
};
|
||||
|
||||
const parsePerturbArretsObject = (p) => {
|
||||
const parsePerturbArretsObject = useCallback((p) => {
|
||||
const raw = p && (p.perturbations_arrets || p.arrets || p.arrets_perturbations);
|
||||
if (!raw) return { arrets: [], jours: null };
|
||||
if (typeof raw === 'object') {
|
||||
@@ -230,7 +230,7 @@ export default function ClassiquesArriveesQuais(){
|
||||
} catch (e) {
|
||||
return { arrets: [], jours: null };
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
const getPerturbationJours = useCallback((p) => {
|
||||
if (!p) return null;
|
||||
@@ -371,7 +371,7 @@ export default function ClassiquesArriveesQuais(){
|
||||
}
|
||||
if (maxDelay != null) return { label: `retardé +${maxDelay}min.`, detail: '', delayMinutes: maxDelay };
|
||||
return { label: "à l'heure", detail: '', delayMinutes: null };
|
||||
}, [findPerturbsForHoraireAndStop, parseDelayMinutesFromArret, getPerturbationJours]);
|
||||
}, [findPerturbsForHoraireAndStop, parseDelayMinutesFromArret, getPerturbationJours, normalizeName]);
|
||||
|
||||
// Fetch perturbations & travaux from Supabase periodically
|
||||
useEffect(() => {
|
||||
@@ -417,7 +417,7 @@ export default function ClassiquesArriveesQuais(){
|
||||
fetchPerturb();
|
||||
const id = setInterval(fetchPerturb, 15000);
|
||||
return () => { mounted = false; clearInterval(id); };
|
||||
}, []);
|
||||
}, [getPerturbationJours]);
|
||||
|
||||
// Annotate selectedHoraire with computed status when perturbations change
|
||||
useEffect(() => {
|
||||
@@ -579,7 +579,7 @@ export default function ClassiquesArriveesQuais(){
|
||||
|
||||
loadNextForQuai();
|
||||
return () => { mounted = false; };
|
||||
}, [gareDisplayParam, gareIdParam, quaiParam, parseTimeHM]);
|
||||
}, [gareDisplayParam, gareIdParam, quaiParam, parseTimeHM, normalizeName]);
|
||||
|
||||
// toggle flag to alternate time/status when needed (observe selectedHoraire.status when present)
|
||||
const [showTime, setShowTime] = useState(true);
|
||||
|
||||
@@ -196,7 +196,7 @@ export default function ClassiquesDepartsQuais(){
|
||||
} catch (e) { return []; }
|
||||
};
|
||||
|
||||
const parsePerturbArretsObject = (p) => {
|
||||
const parsePerturbArretsObject = useCallback((p) => {
|
||||
const raw = p && (p.perturbations_arrets || p.arrets || p.arrets_perturbations);
|
||||
if (!raw) return { arrets: [], jours: null };
|
||||
if (typeof raw === 'object') {
|
||||
@@ -213,7 +213,7 @@ export default function ClassiquesDepartsQuais(){
|
||||
} catch (e) {
|
||||
return { arrets: [], jours: null };
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
const getPerturbationJours = useCallback((p) => {
|
||||
if (!p) return null;
|
||||
@@ -354,7 +354,7 @@ export default function ClassiquesDepartsQuais(){
|
||||
}
|
||||
if (maxDelay != null) return { label: `retardé +${maxDelay}min.`, detail: '', delayMinutes: maxDelay };
|
||||
return { label: "à l'heure", detail: '', delayMinutes: null };
|
||||
}, [findPerturbsForHoraireAndStop, parseDelayMinutesFromArret, getPerturbationJours]);
|
||||
}, [findPerturbsForHoraireAndStop, parseDelayMinutesFromArret, getPerturbationJours, normalizeName]);
|
||||
|
||||
// Fetch perturbations & travaux from Supabase periodically
|
||||
useEffect(() => {
|
||||
@@ -400,7 +400,7 @@ export default function ClassiquesDepartsQuais(){
|
||||
fetchPerturb();
|
||||
const id = setInterval(fetchPerturb, 15000);
|
||||
return () => { mounted = false; clearInterval(id); };
|
||||
}, []);
|
||||
}, [getPerturbationJours]);
|
||||
|
||||
// Annotate selectedHoraire with computed status when perturbations change
|
||||
useEffect(() => {
|
||||
@@ -609,7 +609,7 @@ export default function ClassiquesDepartsQuais(){
|
||||
|
||||
loadNextForQuai();
|
||||
return () => { mounted = false; };
|
||||
}, [gareDisplayParam, gareIdParam, quaiParam, parseTimeHM]);
|
||||
}, [gareDisplayParam, gareIdParam, quaiParam, parseTimeHM, normalizeName]);
|
||||
|
||||
// toggle flag to alternate time/status when needed (observe selectedHoraire.status when present)
|
||||
const [showTime, setShowTime] = useState(true);
|
||||
|
||||
Reference in new issue
Block a user