pl-fe: do not specify 'accept' when set to 'application/octet-stream'

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-09-20 23:58:04 +02:00
parent 6a31cd2c61
commit 9096fdc9fb
2 changed files with 10 additions and 2 deletions

View File

@@ -37,6 +37,9 @@ const UploadButton: React.FC<IUploadButton> = ({
const fileElement = useRef<HTMLInputElement>(null);
const attachmentTypes = configuration.media_attachments.supported_mime_types;
let accept = attachmentTypes?.join(',');
if (accept === 'application/octet-stream') accept = undefined;
const handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
if (e.target.files?.length) {
onSelectFile(e.target.files, intl);
@@ -75,7 +78,7 @@ const UploadButton: React.FC<IUploadButton> = ({
ref={fileElement}
type='file'
multiple
accept={attachmentTypes?.join(',')}
accept={accept}
onChange={handleChange}
disabled={disabled}
className='hidden'