Skip to content

Commit

Permalink
Fix typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Dec 12, 2024
1 parent 16a088f commit 561c690
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ export const CloudQuotaModal = () => {
if (!workspaceQuota) {
return;
}
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
currentWorkspace.engine.blob.singleBlobSizeLimit = bytes.parse(
workspaceQuota.blobLimit.toString()
);
)!;

const disposable = currentWorkspace.engine.blob.onAbortLargeBlob.on(() => {
setOpen(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import {
AttachmentBlockSpec,
ImageBlockService,
} from '@blocksuite/affine/blocks';
import bytes from 'bytes';

// bytes.parse('2GB')
const MAX_FILE_SIZE = 2147483648;

class CustomAttachmentBlockService extends AttachmentBlockService {
override mounted(): void {
// blocksuite default max file size is 10MB, we override it to 2GB
// but the real place to limit blob size is CloudQuotaModal / LocalQuotaModal
this.maxFileSize = bytes.parse('2GB');
this.maxFileSize = MAX_FILE_SIZE;
super.mounted();
}
}
Expand All @@ -24,7 +26,7 @@ class CustomImageBlockService extends ImageBlockService {
override mounted(): void {
// blocksuite default max file size is 10MB, we override it to 2GB
// but the real place to limit blob size is CloudQuotaModal / LocalQuotaModal
this.maxFileSize = bytes.parse('2GB');
this.maxFileSize = MAX_FILE_SIZE;
super.mounted();
}
}
Expand Down

0 comments on commit 561c690

Please sign in to comment.