mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 02:42:25 +08:00
fix(editor): block can be null in widget (#10959)
Closes: [BS-2826](https://linear.app/affine-design/issue/BS-2826/typeerror-thisblock-is-null)
This commit is contained in:
@@ -424,18 +424,20 @@ export class AffineAIPanelWidget extends WidgetComponent {
|
||||
'pointerdown',
|
||||
this._onDocumentClick
|
||||
);
|
||||
this.disposables.add(
|
||||
this.block.host.event.add('pointerDown', evtState =>
|
||||
this._onDocumentClick(
|
||||
evtState.get('pointerState').event as PointerEvent
|
||||
if (this.block) {
|
||||
this.disposables.add(
|
||||
this.block.host.event.add('pointerDown', evtState =>
|
||||
this._onDocumentClick(
|
||||
evtState.get('pointerState').event as PointerEvent
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
this.disposables.add(
|
||||
this.block.host.event.add('click', () => {
|
||||
return this.state !== 'hidden' ? true : false;
|
||||
})
|
||||
);
|
||||
);
|
||||
this.disposables.add(
|
||||
this.block.host.event.add('click', () => {
|
||||
return this.state !== 'hidden' ? true : false;
|
||||
})
|
||||
);
|
||||
}
|
||||
this.disposables.addFromEvent(this, 'wheel', stopPropagation);
|
||||
this.disposables.addFromEvent(this, 'pointerdown', stopPropagation);
|
||||
this.disposables.addFromEvent(this, 'pointerup', stopPropagation);
|
||||
|
||||
Reference in New Issue
Block a user