mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-12 18:15:33 +00:00
refact:generate unique meraid id using crypto.randomUUID
This commit is contained in:
1 parent
b1235f3ce0
commit
c5a8f3abcd
1 file changed
+1
-1
@@ -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