mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-28 15:55:19 +08:00
refactor(editor): remove redundant getOptional for gfx (#10142)
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
TextSelection,
|
||||
WidgetComponent,
|
||||
} from '@blocksuite/block-std';
|
||||
import { GfxController } from '@blocksuite/block-std/gfx';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import { throttle } from '@blocksuite/global/utils';
|
||||
import type { BaseSelection, UserInfo } from '@blocksuite/store';
|
||||
import { computed, effect } from '@preact/signals-core';
|
||||
@@ -308,8 +308,7 @@ export class AffineDocRemoteSelectionWidget extends WidgetComponent {
|
||||
})
|
||||
);
|
||||
|
||||
const gfx = this.std.getOptional(GfxController);
|
||||
if (!gfx) return;
|
||||
const gfx = this.std.get(GfxControllerIdentifier);
|
||||
this.disposables.add(
|
||||
gfx.viewport.viewportUpdated.on(() => {
|
||||
const selections = this._remoteSelections.peek();
|
||||
|
||||
Reference in New Issue
Block a user