diff --git a/public/strategie-script.js b/public/strategie-script.js index 37ca98d..af0f340 100644 --- a/public/strategie-script.js +++ b/public/strategie-script.js @@ -1,5 +1,33 @@ // Script pour la gestion des pages de stratégie (function() { + // VÉRIFICATION IMMÉDIATE DE /team AVANT TOUT (s'exécute en premier) + (function checkTeamRouteFirst() { + if (typeof window === 'undefined') return; + function normalizePath(pathname) { + if (!pathname) return '/'; + const cleaned = pathname.replace(/\/+$/, ''); + return cleaned === '' ? '/' : cleaned; + } + const path = normalizePath(window.location.pathname); + if (path === '/team' || path === '/team/') { + console.log('🔍 Route /team détectée IMMÉDIATEMENT, redirection vers /team.html...'); + // Rediriger immédiatement vers /team.html + if (document.body) { + document.body.innerHTML = '
'; + window.history.pushState({page: 'team'}, 'Équipe & Technologies', '/team'); + } else { + const checkBody = setInterval(() => { + if (document.body) { + clearInterval(checkBody); + document.body.innerHTML = '
'; + window.history.pushState({page: 'team'}, 'Équipe & Technologies', '/team'); + } + }, 10); + setTimeout(() => clearInterval(checkBody), 5000); + } + } + })(); + // Protection contre Fast Refresh : ignorer les tentatives de hot-reload // Intercepter et ignorer les requêtes webpack hot-update pour éviter les rechargements en boucle if (typeof window !== 'undefined') {