diff --git a/packages/editor/src/lib/app/App.ts b/packages/editor/src/lib/app/App.ts index f01dd9370..f4afba600 100644 --- a/packages/editor/src/lib/app/App.ts +++ b/packages/editor/src/lib/app/App.ts @@ -1296,6 +1296,10 @@ export class App extends EventEmitter { // const update = this.getShapeUtil(next).onUpdate?.(prev, next) // return update ?? next // } + @computed + private get _allPageStates() { + return this.store.query.records('instance_page_state') + } /** @internal */ private _shapeWillBeDeleted(deletedShape: TLShape) { @@ -1312,8 +1316,8 @@ export class App extends EventEmitter { this._unbindArrowTerminal(arrow, handleId) } } + const pageStates = this._allPageStates.value - const pageStates = this.store.query.records('instance_page_state').value const deletedIds = new Set([deletedShape.id]) const updates = compact( pageStates.map((pageState) => {