From c029467a3111091a114c301e0a677acd931cc081 Mon Sep 17 00:00:00 2001 From: joshrandall8478 <joshrandall8478@gmail.com> Date: Tue, 18 Mar 2025 23:45:42 -0400 Subject: [PATCH] fixed greyed out button not working --- src/App.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 5bd2214..1fc1017 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -387,7 +387,7 @@ function Home() { className={filteredArray.length < 2 ? "button greyed" : "button"} onClick={() => { const videoElement = document.getElementById("video"); - if (videoElement) { + if (videoElement && filteredArray.length >= 2) { videoElement.classList.remove("fade-in"); videoElement.classList.add("fade-out"); setTimeout(() => { @@ -395,9 +395,7 @@ function Home() { videoElement.classList.remove("fade-out"); videoElement.classList.add("fade-in"); }, 200); // Match the duration of the fade-out animation - } else { - handleNext(); - } + }; }} > <span className="desktop__text">NEXT </span><i className="fa-solid fa-arrow-right"></i> -- GitLab