mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 18:09:58 +08:00
fix(editor): can not add attachment because service not exist (#9952)

This commit is contained in:
@@ -268,13 +268,7 @@ export async function addAttachments(
|
|||||||
): Promise<string[]> {
|
): Promise<string[]> {
|
||||||
if (!files.length) return [];
|
if (!files.length) return [];
|
||||||
|
|
||||||
const attachmentService = std.getService('affine:attachment');
|
|
||||||
const gfx = std.get(GfxControllerIdentifier);
|
const gfx = std.get(GfxControllerIdentifier);
|
||||||
|
|
||||||
if (!attachmentService) {
|
|
||||||
console.error('Attachment service not found');
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
const maxFileSize = std.store.get(FileSizeLimitService).maxFileSize;
|
const maxFileSize = std.store.get(FileSizeLimitService).maxFileSize;
|
||||||
const isSizeExceeded = files.some(file => file.size > maxFileSize);
|
const isSizeExceeded = files.some(file => file.size > maxFileSize);
|
||||||
if (isSizeExceeded) {
|
if (isSizeExceeded) {
|
||||||
|
|||||||
Reference in New Issue
Block a user