Skip to content

Commit

Permalink
fix: initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
doouding committed Dec 18, 2024
1 parent 7564ada commit 4cda4d2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/affine/block-surface/src/view/mindmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export class MindMapView extends GfxElementModelView<MindmapElementModel> {

private _initCollapseButtons() {
const updateButtons = requestThrottledConnectedFrame(() => {
if (!this.isConnected) {
return;
}

const visited = new Set<LocalShapeElementModel>();

this.model.traverse(node => {
Expand Down Expand Up @@ -63,6 +67,8 @@ export class MindMapView extends GfxElementModelView<MindmapElementModel> {
this.disposable.add(() => {
this.model.children.unobserve(updateButtons);
});

updateButtons();
}

private _needToUpdateButtonStyle(options: {
Expand Down

0 comments on commit 4cda4d2

Please sign in to comment.