This commit is contained in:
Sewmina 2025-04-16 04:14:35 +00:00
parent 435d7d5ff9
commit 1c965f9d40
4 changed files with 7 additions and 6 deletions

View File

@ -211,14 +211,14 @@ export default function HeroSection() {
if (ready) {
updateBets();
}
}, [ready, updateBets]);
}, [ready]);
useEffect(() => {
if (!ready) return;
updateBets();
const interval = setInterval(updateBets, 3000);
return () => clearInterval(interval);
}, [ready, updateBets]);
}, [ready]);
useEffect(() => {
const handleMessage = (event: MessageEvent) => {

View File

@ -97,7 +97,7 @@ export default function YourGames({ bets }: GameModalProps) {
updateBets();
const interval = setInterval(updateBets, 10000);
return () => clearInterval(interval);
}, [bets, updateBets]);
}, [bets]);
return (
<section className="py-16 px-6">

View File

@ -343,9 +343,10 @@ export default function PrivyButton() {
) : (
<button
onClick={customLogin}
className="bg-[rgb(248,144,22)] hover:bg-[rgb(248,200,100)] text-black font-bold px-6 py-3 rounded-md transition duration-300 hover:scale-115 w-30 mx-3"
disabled={!ready}
className={`bg-[rgb(248,144,22)] hover:bg-[rgb(248,200,100)] text-black font-bold px-6 py-3 rounded-md transition duration-300 hover:scale-115 w-30 mx-3 ${!ready ? 'opacity-50 cursor-not-allowed' : ''}`}
>
Sign In
{ready ? "Sign In" : "Loading..."}
</button>
)}

View File

@ -40,7 +40,7 @@ export default function YourGames({bets}:GameModalProps) {
updateBets();
const interval = setInterval(updateBets, 10000);
return () => clearInterval(interval);
}, [bets, ready, updateBets]);
}, [bets, ready]);
// Handle bet closing
const handleCloseBet = async () => {