From 378007da815d9d22a2d253831f779704cd2729dd Mon Sep 17 00:00:00 2001 From: fundon Date: Mon, 17 Feb 2025 04:21:00 +0000 Subject: [PATCH] chore(editor): no need to cache attachment embed config map (#10197) ### What's Changed! * no need to cache attachment embed config map --- blocksuite/affine/block-attachment/src/embed.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/blocksuite/affine/block-attachment/src/embed.ts b/blocksuite/affine/block-attachment/src/embed.ts index 8fffb783eeec5..0e50e751465d4 100644 --- a/blocksuite/affine/block-attachment/src/embed.ts +++ b/blocksuite/affine/block-attachment/src/embed.ts @@ -71,10 +71,11 @@ export class AttachmentEmbedService extends Extension { return this.configs.values(); } - constructor( - private readonly std: BlockStdScope, - private readonly configs: Map - ) { + get configs(): Map { + return this.std.get(AttachmentEmbedConfigMapIdentifier); + } + + constructor(private readonly std: BlockStdScope) { super(); } @@ -82,10 +83,7 @@ export class AttachmentEmbedService extends Extension { di.addImpl(AttachmentEmbedConfigMapIdentifier, provider => provider.getAll(AttachmentEmbedConfigIdentifier) ); - di.addImpl(AttachmentEmbedProvider, AttachmentEmbedService, [ - StdIdentifier, - AttachmentEmbedConfigMapIdentifier, - ]); + di.addImpl(AttachmentEmbedProvider, this, [StdIdentifier]); } // Converts to embed view.