Replace Date.now().toString() with crypto.randomUUID() for ID generation

This commit is contained in:
2026-06-22 21:10:10 +00:00
parent 4b2ee0bc75
commit f0aec3a804
+2 -2
View File
@@ -26,7 +26,7 @@ class TableTool extends Tool {
const x = this.startPoint.x; const x = this.startPoint.x;
const y = this.startPoint.y; const y = this.startPoint.y;
this.yjsDoc.createElement({ this.yjsDoc.createElement({
id: Date.now().toString(), id: crypto.randomUUID(),
type: 'round_table', type: 'round_table',
layerId: 'default', layerId: 'default',
x: x - this.radius, x: x - this.radius,
@@ -46,7 +46,7 @@ class TableTool extends Tool {
const width = Math.abs(event.clientX - this.startPoint.x); const width = Math.abs(event.clientX - this.startPoint.x);
const height = Math.abs(event.clientY - this.startPoint.y); const height = Math.abs(event.clientY - this.startPoint.y);
this.yjsDoc.createElement({ this.yjsDoc.createElement({
id: Date.now().toString(), id: crypto.randomUUID(),
type: 'rectangular_table', type: 'rectangular_table',
layerId: 'default', layerId: 'default',
x, x,