Skip to content

Commit

Permalink
chore(editor): no need to cache attachment embed config map (#10197)
Browse files Browse the repository at this point in the history
### What's Changed!

* no need to cache attachment embed config map
  • Loading branch information
fundon committed Feb 17, 2025
1 parent 594224e commit 378007d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions blocksuite/affine/block-attachment/src/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,19 @@ 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();
}

static override setup(di: Container) {
di.addImpl(AttachmentEmbedConfigMapIdentifier, provider =>
provider.getAll(AttachmentEmbedConfigIdentifier)
);
di.addImpl(AttachmentEmbedProvider, AttachmentEmbedService, [
StdIdentifier,
AttachmentEmbedConfigMapIdentifier,
]);
di.addImpl(AttachmentEmbedProvider, this, [StdIdentifier]);
}

// Converts to embed view.
Expand Down

0 comments on commit 378007d

Please sign in to comment.