Replace Date.now().toString() with crypto.randomUUID() for ID generation
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user