mirror of https://github.com/usememos/memos.git
when the type is not found default to text/plain
This commit is contained in:
parent
c76ffb0fe4
commit
062ebf207c
8057
web/pnpm-lock.yaml
8057
web/pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
|
@ -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;
|
||||
Loading…
Reference in New Issue