fix: update infraBtn href after render() so ?cv= param is correctly passed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9474c61c0a
commit
20c8280e4a
1 changed files with 4 additions and 3 deletions
|
|
@ -3346,9 +3346,6 @@
|
||||||
const cvAllowed = ['ux', 'dsi'];
|
const cvAllowed = ['ux', 'dsi'];
|
||||||
const cvFile = cvAllowed.includes(cvParam) ? `cv-data-${cvParam}.json` : 'cv-data.json';
|
const cvFile = cvAllowed.includes(cvParam) ? `cv-data-${cvParam}.json` : 'cv-data.json';
|
||||||
|
|
||||||
const infraBtn = document.getElementById('infraBtn');
|
|
||||||
if (infraBtn && cvParam) infraBtn.href = `infrastructure.html?cv=${cvParam}`;
|
|
||||||
|
|
||||||
fetch(cvFile)
|
fetch(cvFile)
|
||||||
.then(r => {
|
.then(r => {
|
||||||
if (!r.ok) throw new Error('Impossible de charger ' + cvFile + ' (code ' + r.status + ')');
|
if (!r.ok) throw new Error('Impossible de charger ' + cvFile + ' (code ' + r.status + ')');
|
||||||
|
|
@ -3358,6 +3355,10 @@
|
||||||
render(data);
|
render(data);
|
||||||
injectSEO(data);
|
injectSEO(data);
|
||||||
|
|
||||||
|
// Mettre à jour le lien infra APRÈS render (l'élément existe maintenant dans le DOM)
|
||||||
|
const infraBtn = document.getElementById('infraBtn');
|
||||||
|
if (infraBtn && cvParam) infraBtn.href = `infrastructure.html?cv=${cvParam}`;
|
||||||
|
|
||||||
// Restaurer le thème sauvegardé
|
// Restaurer le thème sauvegardé
|
||||||
const saved = localStorage.getItem('cv-theme');
|
const saved = localStorage.getItem('cv-theme');
|
||||||
if (saved && ['cyberpunk','bd','itpro','cgi'].includes(saved)) setTheme(saved);
|
if (saved && ['cyberpunk','bd','itpro','cgi'].includes(saved)) setTheme(saved);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue