fix(core): allow unused blobs to preview in new tab (#10874)

fix AF-2330
This commit is contained in:
pengx17
2025-03-19 02:40:06 +00:00
parent d8567e669a
commit 6b73e8ebb5

View File

@@ -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');