Fix toast duplication in remaining pages
cgen-8605ceec0cb147cdbfe647c46fce3d85
This commit is contained in:
parent
08576de54c
commit
65fbe2250b
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";
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue