Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: No error message when uploading a file that is not allowed #31346

Merged
merged 3 commits into from Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-shrimps-draw.md
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixed error message when uploading a file that is not allowed
2 changes: 1 addition & 1 deletion apps/meteor/client/lib/chats/flows/uploadFiles.ts

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can't detrminate a MIME type of a file (file.type) it will return a false and all not recognised types will be not work at all even if "Accepted Media Types" is empty.
Please revert

Expand Up @@ -46,7 +46,7 @@ export const uploadFiles = async (chat: ChatAPI, files: readonly File[], resetFi
imperativeModal.close();
uploadNextFile();
},
invalidContentType: Boolean(file.type && !fileUploadIsValidContentType(file.type)),
invalidContentType: !(file.type && fileUploadIsValidContentType(file.type)),
},
});
};
Expand Down