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.

fix(editor): can not add attachment because service not exist (#9952)

Flrandec8790d20dab3
diff --git a/blocksuite/affine/block-attachment/src/utils.ts b/blocksuite/affine/block-attachment/src/utils.ts
index 593d39a7be..cba8ac8ba2 100644
--- a/blocksuite/affine/block-attachment/src/utils.ts
+++ b/blocksuite/affine/block-attachment/src/utils.ts
@@ -268,13 +268,7 @@ export async function addAttachments(
): Promise<string[]> {
if (!files.length) return [];
- const attachmentService = std.getService('affine:attachment');
const gfx = std.get(GfxControllerIdentifier);
-
- if (!attachmentService) {
- console.error('Attachment service not found');
- return [];
- }
const maxFileSize = std.store.get(FileSizeLimitService).maxFileSize;
const isSizeExceeded = files.some(file => file.size > maxFileSize);
if (isSizeExceeded) {