when the type is not found default to text/plain

This commit is contained in:
SaraVieira 2025-08-10 14:09:29 +01:00
parent c76ffb0fe4
commit 062ebf207c
No known key found for this signature in database
GPG Key ID: D31B9EE2FD5463CC
2 changed files with 3576 additions and 4486 deletions

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@ import { attachmentStore } from "@/store";
import { Attachment } from "@/types/proto/api/v1/attachment_service";
import { MemoEditorContext } from "../types";
interface Props {
isUploading?: boolean;
}
@ -52,7 +53,7 @@ const UploadAttachmentButton = observer((props: Props) => {
attachment: Attachment.fromPartial({
filename,
size,
type: type || mime.getType(filename) || "",
type: type || mime.getType(filename) || "text/plain",
content: buffer,
}),
attachmentId: "",
@ -101,4 +102,4 @@ const UploadAttachmentButton = observer((props: Props) => {
);
});
export default UploadAttachmentButton;
export default UploadAttachmentButton;