Skip to content

Commit

Permalink
fix(edgeless): fix frame not update in collaboration (#5232)
Browse files Browse the repository at this point in the history
  • Loading branch information
regischen authored Nov 7, 2023
1 parent 2f248df commit a572bd9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ export class EdgelessFramesContainer extends WithDisposable(ShadowlessElement) {
}

protected override firstUpdated() {
this._disposables.add(
this.surface.page.slots.historyUpdated.on(() => this.requestUpdate())
const { _disposables, surface } = this;

_disposables.add(
surface.page.slots.blockUpdated.on(({ flavour }) => {
if (flavour === FRAME) {
this.requestUpdate();
}
})
);

this.surface.edgeless.slots.edgelessToolUpdated.on(tool => {
Expand Down
5 changes: 4 additions & 1 deletion packages/store/src/workspace/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class Page extends Space<FlatBlockMap> {
| {
type: 'add';
id: string;
flavour: string;
}
| {
type: 'delete';
Expand All @@ -80,6 +81,7 @@ export class Page extends Space<FlatBlockMap> {
| {
type: 'update';
id: string;
flavour: string;
props: Partial<BlockProps>;
}
>(),
Expand Down Expand Up @@ -522,6 +524,7 @@ export class Page extends Space<FlatBlockMap> {

this.slots.blockUpdated.emit({
type: 'update',
flavour: model.flavour,
id: model.id,
props,
});
Expand Down Expand Up @@ -724,7 +727,7 @@ export class Page extends Space<FlatBlockMap> {
return;
}

this.slots.blockUpdated.emit({ type: 'add', id });
this.slots.blockUpdated.emit({ type: 'add', id, flavour: model.flavour });
}

private _handleYBlockDelete(id: string) {
Expand Down

1 comment on commit a572bd9

@vercel
Copy link

@vercel vercel bot commented on a572bd9 Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

blocksuite – ./packages/playground

blocksuite-git-master-toeverything.vercel.app
blocksuite-five.vercel.app
blocksuite-toeverything.vercel.app

Please sign in to comment.