From 112ba401d782421ce634d3255730a259b648cda0 Mon Sep 17 00:00:00 2001 From: syoul Date: Tue, 9 Dec 2025 12:17:42 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20v=C3=A9rification=20/team=20au=20tout=20?= =?UTF-8?q?d=C3=A9but=20du=20script=20et=20nettoyage=20triple?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Vérification de /team au tout début du script (avant Fast Refresh protection) - Triple nettoyage dans le script Python (3 patterns différents) - Redirection immédiate vers /team.html sans attendre Cela devrait enfin fonctionner car : - Le script s'exécute en premier - Tous les formats de liens sont supprimés - La redirection est immédiate --- public/strategie-script.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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') {