fix: move hooks before ready guard — React rules of hooks
Some checks failed
CI/CD — Build & Deploy / Build & Deploy (push) Failing after 17s

This commit is contained in:
2026-03-24 14:40:32 +01:00
parent 8ce54bfb03
commit e175844d87

View File

@@ -22,16 +22,6 @@ export default function Home() {
const state = useGameStore((s) => s.state); const state = useGameStore((s) => s.state);
const clickGain = getClickGain(state); const clickGain = getClickGain(state);
if (!ready) {
return (
<section className="game-container">
<p style={{ textAlign: "center", color: "#6b7a99", marginTop: "20vh" }}>
Chargement de ta progression...
</p>
</section>
);
}
const createParticle = useCallback((clientX, clientY) => { const createParticle = useCallback((clientX, clientY) => {
const particle = document.createElement("span"); const particle = document.createElement("span");
particle.className = "click-particle"; particle.className = "click-particle";
@@ -120,6 +110,16 @@ export default function Home() {
return () => rain.stop(); return () => rain.stop();
}, [toggleRain]); }, [toggleRain]);
if (!ready) {
return (
<section className="game-container">
<p style={{ textAlign: "center", color: "#6b7a99", marginTop: "20vh" }}>
Chargement de ta progression...
</p>
</section>
);
}
return ( return (
<main className="zone" data-zone="swamp"> <main className="zone" data-zone="swamp">
<Helmet> <Helmet>