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

![image](https://github.com/user-attachments/assets/0d78058a-4e30-4133-8c63-238456e70f34)
This commit is contained in:
Flrande
2025-02-05 09:29:24 +00:00
parent 75c4291325
commit c8790d20da

View File

@@ -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) {