Skip to content

Commit

Permalink
fix(editor): crud this error (#9350)
Browse files Browse the repository at this point in the history
  • Loading branch information
Saul-Mirone authored Dec 26, 2024
1 parent 690a79b commit 0c849e1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions blocksuite/affine/block-surface/src/extensions/crud-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class EdgelessCRUDExtension extends Extension {
return this._gfx.surface as SurfaceBlockModel | null;
}

deleteElements(elements: BlockSuite.EdgelessModel[]) {
deleteElements = (elements: BlockSuite.EdgelessModel[]) => {
const surface = this._surface;
if (!surface) {
console.error('surface is not initialized');
Expand All @@ -60,14 +60,14 @@ export class EdgelessCRUDExtension extends Extension {
gfx.deleteElement(element.id);
}
});
}
};

addBlock(
addBlock = (
flavour: BlockSuite.EdgelessModelKeys | string,
props: Record<string, unknown>,
parentId?: string | BlockModel,
parentIndex?: number
) {
) => {
const gfx = this.std.get(GfxControllerIdentifier);
const key = getLastPropsKey(flavour as BlockSuite.EdgelessModelKeys, props);
if (key) {
Expand All @@ -85,9 +85,9 @@ export class EdgelessCRUDExtension extends Extension {
parentId,
parentIndex
);
}
};

addElement<T extends Record<string, unknown>>(type: string, props: T) {
addElement = <T extends Record<string, unknown>>(type: string, props: T) => {
const surface = this._surface;
if (!surface) {
console.error('surface is not initialized');
Expand All @@ -107,7 +107,7 @@ export class EdgelessCRUDExtension extends Extension {
};

return surface.addElement(nProps);
}
};

updateElement = (id: string, props: Record<string, unknown>) => {
const surface = this._surface;
Expand Down

0 comments on commit 0c849e1

Please sign in to comment.