Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
doouding committed Oct 16, 2024
1 parent af0c89c commit 3a340e7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/framework/block-std/src/gfx/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,15 @@ export class GfxController extends LifeCycleWatcher {
this._disposables.dispose();
}

updateElement(element: GfxModel, props: Record<string, unknown>): void {
if (this.surface?.hasElementById(element.id)) {
this.surface.updateElement(element.id, props);
updateElement(
element: GfxModel | string,
props: Record<string, unknown>
): void {
const elemId = typeof element === 'string' ? element : element.id;
if (this.surface?.hasElementById(elemId)) {
this.surface.updateElement(elemId, props);
} else {
const hasBlock = this.doc.hasBlock(element.id);
const hasBlock = this.doc.hasBlock(elemId);
hasBlock && this.doc.updateBlock(element as GfxBlockElementModel, props);
}
}
Expand Down

0 comments on commit 3a340e7

Please sign in to comment.