Fix toast duplication in GameDevelopment page
cgen-bf5e67047f204ceb9aa17ca946f0d3a7
This commit is contained in:
parent
49b0583f95
commit
08576de54c
1 changed files with 7 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue