Skip to content

Commit

Permalink
fix(tools): dropzone properly support */* mimetype
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin committed Sep 12, 2024
1 parent 09b7038 commit 423902c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/components/chat/FileDropzone.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
!mimeTypes.some((mimeType: string) => {
const [type, subtype] = mimeType.split("/");
const [fileType, fileSubtype] = file.type.split("/");
return type === fileType && (subtype === "*" || fileSubtype === subtype);
return (
(type === "*" || type === fileType) &&
(subtype === "*" || subtype === fileSubtype)
);
})
) {
setErrorMsg(`Some file type not supported. Only allowed: ${mimeTypes.join(", ")}`);
Expand Down

0 comments on commit 423902c

Please sign in to comment.