From 1cd9cb4e32153199f0ad8ff328bdc5a584f8eca5 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 5 Aug 2025 23:38:07 +0000 Subject: [PATCH] Add ref guard to prevent duplicate toast calls cgen-96d5fe7b5c8849eeb5f87d4c379afb31 --- client/pages/Documentation.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/pages/Documentation.tsx b/client/pages/Documentation.tsx index e57d6d98..af005521 100644 --- a/client/pages/Documentation.tsx +++ b/client/pages/Documentation.tsx @@ -24,11 +24,15 @@ import { export default function Documentation() { const [isLoading, setIsLoading] = useState(true); const [searchQuery, setSearchQuery] = useState(""); + const toastShownRef = useRef(false); useEffect(() => { const timer = setTimeout(() => { setIsLoading(false); - aethexToast.system("Documentation center loaded"); + if (!toastShownRef.current) { + aethexToast.system("Documentation center loaded"); + toastShownRef.current = true; + } }, 1000); return () => clearTimeout(timer);