Fix toast duplication in GameDevelopment page

cgen-bf5e67047f204ceb9aa17ca946f0d3a7
This commit is contained in:
Builder.io 2025-08-05 23:38:43 +00:00
parent 49b0583f95
commit 08576de54c

View file

@ -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);