diff --git a/blocksuite/affine/block-database/src/data-source.ts b/blocksuite/affine/block-database/src/data-source.ts index 964da1793db90..a6b90d95479db 100644 --- a/blocksuite/affine/block-database/src/data-source.ts +++ b/blocksuite/affine/block-database/src/data-source.ts @@ -34,8 +34,6 @@ import { } from './properties/index.js'; import { addProperty, - applyCellsUpdate, - applyPropertyUpdate, copyCellsByProperty, deleteRows, deleteView, @@ -169,7 +167,6 @@ export class DatabaseBlockDataSource extends DataSourceBase { columnId: propertyId, value: newValue, }); - applyCellsUpdate(this._model); } } @@ -199,7 +196,6 @@ export class DatabaseBlockDataSource extends DataSourceBase { insertToPosition, property.create(this.newPropertyName()) ); - applyPropertyUpdate(this._model); return result; } @@ -283,7 +279,6 @@ export class DatabaseBlockDataSource extends DataSourceBase { propertyDataSet(propertyId: string, data: Record): void { this._runCapture(); this.updateProperty(propertyId, () => ({ data })); - applyPropertyUpdate(this._model); } propertyDataTypeGet(propertyId: string): TypeInstance | undefined { @@ -337,7 +332,6 @@ export class DatabaseBlockDataSource extends DataSourceBase { schema ); copyCellsByProperty(this._model, copyId, id); - applyPropertyUpdate(this._model); return id; } @@ -366,7 +360,6 @@ export class DatabaseBlockDataSource extends DataSourceBase { propertyNameSet(propertyId: string, name: string): void { this.doc.captureSync(); this.updateProperty(propertyId, () => ({ name })); - applyPropertyUpdate(this._model); } override propertyReadonlyGet(propertyId: string): boolean { @@ -421,7 +414,6 @@ export class DatabaseBlockDataSource extends DataSourceBase { } }); updateCells(this._model, propertyId, cells); - applyPropertyUpdate(this._model); } rowAdd(insertPosition: InsertToPosition | number): string { diff --git a/blocksuite/affine/block-database/src/utils/block-utils.ts b/blocksuite/affine/block-database/src/utils/block-utils.ts index 40d33789ffe78..57729d6872d23 100644 --- a/blocksuite/affine/block-database/src/utils/block-utils.ts +++ b/blocksuite/affine/block-database/src/utils/block-utils.ts @@ -37,24 +37,6 @@ export function addProperty( return id; } -export function applyCellsUpdate(model: DatabaseBlockModel) { - model.doc.updateBlock(model, { - cells: model.cells, - }); -} - -export function applyPropertyUpdate(model: DatabaseBlockModel) { - model.doc.updateBlock(model, { - columns: model.columns, - }); -} - -export function applyViewsUpdate(model: DatabaseBlockModel) { - model.doc.updateBlock(model, { - views: model.views, - }); -} - export function copyCellsByProperty( model: DatabaseBlockModel, fromId: Column['id'], @@ -156,7 +138,6 @@ export function moveViewTo( arr => insertPositionToIndex(position, arr) ); }); - applyViewsUpdate(model); } export function updateCell( @@ -255,6 +236,5 @@ export const updateView = ( return { ...v, ...update(v as ViewData) }; }); }); - applyViewsUpdate(model); }; export const DATABASE_CONVERT_WHITE_LIST = ['affine:list', 'affine:paragraph'];