Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

chore(editor): no need to cache attachment embed config map (#10197)

fundon378007da815d
diff --git a/blocksuite/affine/block-attachment/src/embed.ts b/blocksuite/affine/block-attachment/src/embed.ts
index 8fffb783ee..0e50e75146 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<string, AttachmentEmbedConfig>
- ) {
+ get configs(): Map<string, AttachmentEmbedConfig> {
+ 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.