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(core): allow unused blobs to preview in new tab (#10874)

pengx176b73e8ebb597
diff --git a/packages/frontend/core/src/modules/blob-management/entity/unused-blobs.ts b/packages/frontend/core/src/modules/blob-management/entity/unused-blobs.ts
index c190e692d2..aadfa8de1d 100644
--- a/packages/frontend/core/src/modules/blob-management/entity/unused-blobs.ts
+++ b/packages/frontend/core/src/modules/blob-management/entity/unused-blobs.ts
@@ -159,8 +159,8 @@ export class UnusedBlobs extends Entity {
return null;
}
- const url = URL.createObjectURL(new Blob([blob]));
const mime = record.mime || fileType?.mime || 'unknown';
+ const url = URL.createObjectURL(new Blob([blob], { type: mime }));
// todo(@pengx17): the following may not be sufficient
const extension = fileType?.ext;
const type = extension ?? (mime?.startsWith('text/') ? 'txt' : 'unknown');