From 7ae5a9c5a5c076e62578a9829d150e563ec77198 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 21 Aug 2025 14:50:37 +0100 Subject: [PATCH] Refactor diagramId initialization to use a combination of Date.now() and random string for uniqueness --- frontend/src/components/MermaidRenderer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/MermaidRenderer.tsx b/frontend/src/components/MermaidRenderer.tsx index 41291537..1d3314e2 100644 --- a/frontend/src/components/MermaidRenderer.tsx +++ b/frontend/src/components/MermaidRenderer.tsx @@ -16,7 +16,9 @@ const MermaidRenderer: React.FC = ({ isLoading, }) => { const [isDarkTheme] = useDarkTheme(); - const diagramId = useRef(`mermaid-${crypto.randomUUID()}`); + const diagramId = useRef( + `mermaid-${Date.now()}-${Math.random().toString(36).substring(2)}`, + ); const status = useSelector(selectStatus); const [error, setError] = useState(null); const [showCode, setShowCode] = useState(false);