refactor(editor): reduce getService (#10100)

This commit is contained in:
Saul-Mirone
2025-02-11 12:26:01 +00:00
parent dbf0f9dc20
commit 6b78d2dcf2
33 changed files with 189 additions and 300 deletions
@@ -1,5 +1,7 @@
import type { Command } from '@blocksuite/block-std';
import { SurfaceBlockService } from '../surface-service';
/**
* Re-associate bindings for block that have been converted.
*
@@ -11,7 +13,7 @@ export const reassociateConnectorsCommand: Command<{
newId: string;
}> = (ctx, next) => {
const { oldId, newId } = ctx;
const service = ctx.std.getService('affine:surface');
const service = ctx.std.get(SurfaceBlockService);
if (!oldId || !newId || !service) {
next();
return;