mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
refact:generate unique meraid id using crypto.randomUUID
This commit is contained in:
@@ -32,7 +32,7 @@ const MermaidRenderer: React.FC<MermaidRendererProps> = ({
|
||||
const renderDiagram = async (): Promise<void> => {
|
||||
try {
|
||||
// Generate unique ID
|
||||
const id = `mermaid-${Math.random().toString(36).substring(2, 9)}`;
|
||||
const id = `mermaid-${crypto.randomUUID()}`;
|
||||
|
||||
// Render the diagram
|
||||
const { svg } = await mermaid.render(id, code);
|
||||
|
||||
Reference in New Issue
Block a user