diff --git a/packages/editor/src/lib/editor/Editor.ts b/packages/editor/src/lib/editor/Editor.ts index 9503cb874..35faa8fe6 100644 --- a/packages/editor/src/lib/editor/Editor.ts +++ b/packages/editor/src/lib/editor/Editor.ts @@ -1871,7 +1871,7 @@ export class Editor extends EventEmitter { setHoveredShape(shape: TLShapeId | TLShape | null): this { const id = typeof shape === 'string' ? shape : shape?.id ?? null if (id === this.getHoveredShapeId()) return this - this.updateCurrentPageState({ hoveredShapeId: id }) + this.updateCurrentPageState({ hoveredShapeId: id }, { history: 'ignore' }) return this } @@ -3217,7 +3217,7 @@ export class Editor extends EventEmitter { }) transact(() => { - this.updateInstanceState({ followingUserId: userId }) + this.updateInstanceState({ followingUserId: userId }, { history: 'ignore' }) // we listen for page changes separately from the 'moveTowardsUser' tick const dispose = react('update current page', () => { @@ -3331,7 +3331,7 @@ export class Editor extends EventEmitter { * @public */ stopFollowingUser(): this { - this.batch(() => { + this.history.ignore(() => { // commit the current camera to the store this.store.put([this.getCamera()]) // this must happen after the camera is committed @@ -3817,7 +3817,8 @@ export class Editor extends EventEmitter { createAssets(assets: TLAsset[]): this { if (this.getInstanceState().isReadonly) return this if (assets.length <= 0) return this - return this.batch(() => this.store.put(assets)) + this.history.ignore(() => this.store.put(assets)) + return this } /** @@ -3835,7 +3836,7 @@ export class Editor extends EventEmitter { updateAssets(assets: TLAssetPartial[]): this { if (this.getInstanceState().isReadonly) return this if (assets.length <= 0) return this - return this.batch(() => { + this.history.ignore(() => { this.store.put( assets.map((partial) => ({ ...this.store.get(partial.id)!, @@ -3843,6 +3844,7 @@ export class Editor extends EventEmitter { })) ) }) + return this } /** @@ -3866,7 +3868,8 @@ export class Editor extends EventEmitter { : (assets as TLAsset[]).map((a) => a.id) if (ids.length <= 0) return this - return this.batch(() => this.store.remove(ids)) + this.history.ignore(() => this.store.remove(ids)) + return this } /**