V1.1.2 //

-> Conversion du temps de retard pour >=60 Min
-> Amélioration du rendu EVA (AFFICHEUR ABANDONNÉ PAR SNCF, Abandon possible)
-> AFFICHAGE DE TOUTES LES DONNÉES EN MÊME TEMPS
This commit is contained in:
AdminGit committed 2026-10-07 22:43:36 +02:00
1 parent 23828a54ef
commit 8f00da0896
13 files changed
+1115 -270

No files matched your search

@@ -630,7 +630,12 @@ export default function ClassiquesDeparts({ defilement = null } = {}){
}
if (isSuppressed) return { label: 'supprimé', detail: '', delayMinutes: null, causeDetails };
if (maxDelay != null) return { label: `retardé +${maxDelay}min.`, detail: '', delayMinutes: maxDelay, causeDetails };
if (maxDelay != null) {
const dH = Math.floor(maxDelay / 60);
const dRem = maxDelay % 60;
const dStr = maxDelay >= 60 ? (dRem > 0 ? `${dH}h${String(dRem).padStart(2, '0')}` : `${dH}h`) : `${maxDelay}min.`;
return { label: `retardé +${dStr}`, detail: '', delayMinutes: maxDelay, causeDetails };
}
return { label: "à l'heure", detail: '', delayMinutes: null, causeDetails };
}, [buildPerturbMap, getPerturbationJours, parsePerturbArretsObject, parseDelayMinutesFromArret, normalizeName, getStops]);
@@ -1178,7 +1183,14 @@ export default function ClassiquesDeparts({ defilement = null } = {}){
const intervalMs = 15000; // 15 secondes par défaut
const intervalId = setInterval(fetchData, intervalMs);
const onRtUpdate = () => { if (mounted) fetchData(); };
let rtDebounce = null;
const onRtUpdate = () => {
if (!mounted) return;
clearTimeout(rtDebounce);
rtDebounce = setTimeout(() => {
if (mounted) fetchData();
}, 2000);
};
if (typeof window !== 'undefined') {
window.addEventListener('sncf-realtime-updated', onRtUpdate);
}
@@ -1186,11 +1198,12 @@ export default function ClassiquesDeparts({ defilement = null } = {}){
return () => {
mounted = false;
clearInterval(intervalId);
clearTimeout(rtDebounce);
if (typeof window !== 'undefined') {
window.removeEventListener('sncf-realtime-updated', onRtUpdate);
}
};
}, [gareDisplay, gareParam, gareIdParam, parseTimeHM, buildPerturbMap, computeStatusForHoraireAtStop, findPerturbsForHoraireAndStop, normalizeName, formatTimeFromHM, applyPerturbationsToHoraires, debug, getStops, getPerturbationJours, defilementMode]);
}, [gareDisplay, gareParam, gareIdParam, defilementMode]);
// Helpers pour perturbations (memoized plus haut)