Fix toast duplication in remaining pages

cgen-8605ceec0cb147cdbfe647c46fce3d85
This commit is contained in:
Builder.io 2025-08-05 23:38:48 +00:00
parent 08576de54c
commit 65fbe2250b

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";
@ -34,10 +34,15 @@ export default function DevelopmentConsulting() {
const [isLoading, setIsLoading] = useState(true);
const [activePackage, setActivePackage] = useState(0);
const toastShownRef = useRef(false);
useEffect(() => {
const timer = setTimeout(() => {
setIsLoading(false);
aethexToast.system("Development Consulting services loaded");
if (!toastShownRef.current) {
aethexToast.system("Development Consulting services loaded");
toastShownRef.current = true;
}
}, 1000);
return () => clearTimeout(timer);