From 08576de54c364561967a97f35ebfe771c9ecc0b2 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 5 Aug 2025 23:38:43 +0000 Subject: [PATCH] Fix toast duplication in GameDevelopment page cgen-bf5e67047f204ceb9aa17ca946f0d3a7 --- client/pages/GameDevelopment.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/pages/GameDevelopment.tsx b/client/pages/GameDevelopment.tsx index 718822d9..db054e47 100644 --- a/client/pages/GameDevelopment.tsx +++ b/client/pages/GameDevelopment.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import Layout from "@/components/Layout"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; @@ -33,10 +33,15 @@ export default function GameDevelopment() { const [isLoading, setIsLoading] = useState(true); const [activeService, setActiveService] = useState(0); + const toastShownRef = useRef(false); + useEffect(() => { const timer = setTimeout(() => { setIsLoading(false); - aethexToast.system("Game Development services loaded successfully"); + if (!toastShownRef.current) { + aethexToast.system("Game Development services loaded successfully"); + toastShownRef.current = true; + } }, 1000); return () => clearTimeout(timer);