From 49b0583f952ec8d639f1bbb21c186771b53c21f5 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 5 Aug 2025 23:38:37 +0000 Subject: [PATCH] Fix toast duplication in Community page cgen-af386be49c38428e8eab4146b8121f97 --- client/pages/Community.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/pages/Community.tsx b/client/pages/Community.tsx index 7e414a26..74d6179d 100644 --- a/client/pages/Community.tsx +++ b/client/pages/Community.tsx @@ -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"; @@ -26,11 +26,15 @@ import { export default function Community() { const [isLoading, setIsLoading] = useState(true); + const toastShownRef = useRef(false); useEffect(() => { const timer = setTimeout(() => { setIsLoading(false); - aethexToast.system("Community hub connected"); + if (!toastShownRef.current) { + aethexToast.system("Community hub connected"); + toastShownRef.current = true; + } }, 1000); return () => clearTimeout(timer);