mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-09 21:25:45 +08:00
0be30f15ea
Fixes [BS-3152](https://linear.app/affine-design/issue/BS-3152/) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved widget stability by removing the event listener that caused the widget to hide on block updates, leaving only viewport changes to trigger hiding. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
22 lines
489 B
TypeScript
22 lines
489 B
TypeScript
import { PageViewportService } from '@blocksuite/affine-shared/services';
|
|
|
|
import type { AffineDragHandleWidget } from '../drag-handle.js';
|
|
|
|
export class PageWatcher {
|
|
get pageViewportService() {
|
|
return this.widget.std.get(PageViewportService);
|
|
}
|
|
|
|
constructor(readonly widget: AffineDragHandleWidget) {}
|
|
|
|
watch() {
|
|
const { disposables } = this.widget;
|
|
|
|
disposables.add(
|
|
this.pageViewportService.subscribe(() => {
|
|
this.widget.hide();
|
|
})
|
|
);
|
|
}
|
|
}
|