|
@@ -473,6 +473,7 @@ export class TldrawApp extends StateManager<TDSnapshot> {
|
473
|
473
|
if (this.callbacks.onChangePage) {
|
474
|
474
|
this.broadcastPageChanges()
|
475
|
475
|
}
|
|
476
|
+ this.callbacks.onPersist?.(this)
|
476
|
477
|
}
|
477
|
478
|
|
478
|
479
|
private prevSelectedIds = this.selectedIds
|
|
@@ -506,26 +507,6 @@ export class TldrawApp extends StateManager<TDSnapshot> {
|
506
|
507
|
const changedShapes: Record<string, TDShape | undefined> = {}
|
507
|
508
|
const changedBindings: Record<string, TDBinding | undefined> = {}
|
508
|
509
|
|
509
|
|
- // const visitedIds = new Set<string>()
|
510
|
|
- // const shapesToVisit = this.shapes
|
511
|
|
-
|
512
|
|
- // while (shapesToVisit.length > 0) {
|
513
|
|
- // const shape = shapesToVisit.pop()
|
514
|
|
- // if (!shape) break
|
515
|
|
- // visitedIds.add(shape.id)
|
516
|
|
- // if (this.prevShapes[shape.id] !== shape) {
|
517
|
|
- // changedShapes[shape.id] = shape
|
518
|
|
-
|
519
|
|
- // if (shape.parentId !== this.currentPageId) {
|
520
|
|
- // shapesToVisit.push(this.page.shapes[shape.parentId])
|
521
|
|
- // }
|
522
|
|
-
|
523
|
|
- // if (shape.children) {
|
524
|
|
-
|
525
|
|
- // }
|
526
|
|
- // }
|
527
|
|
- // }
|
528
|
|
-
|
529
|
510
|
this.shapes.forEach((shape) => {
|
530
|
511
|
visited.add(shape.id)
|
531
|
512
|
if (this.prevShapes[shape.id] !== shape) {
|
|
@@ -558,7 +539,6 @@ export class TldrawApp extends StateManager<TDSnapshot> {
|
558
|
539
|
|
559
|
540
|
this.justSent = true
|
560
|
541
|
this.callbacks.onChangePage?.(this, changedShapes, changedBindings)
|
561
|
|
- this.callbacks.onPersist?.(this)
|
562
|
542
|
this.prevShapes = this.page.shapes
|
563
|
543
|
this.prevBindings = this.page.bindings
|
564
|
544
|
}
|