Skip to content
Snippets Groups Projects
Commit 0d8a97d9 authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

fix

parent bb7b5463
No related branches found
No related tags found
No related merge requests found
Pipeline #6583 passed
......@@ -35,16 +35,14 @@ const allowedFileTypes = [
'application/x-zip',
];
// const allowedFileEnds = ['.zip', '.jpeg', '.jpg', '.jpe', '.png'];
const allowedFileEnds = ['.zip', '.jpeg', '.jpg', '.jpe', '.png'];
function validateFileName(fileNameToValidate) {
return true;
// return (
// allowedFileEnds.find((typeName) => {
// return fileNameToValidate.toLowerCase().endsWith(typeName);
// }).length > 0
// );
return (
allowedFileEnds.find((typeName) => {
return fileNameToValidate.toLowerCase().endsWith(typeName);
}).length > 0
);
}
// in megabytes
......@@ -223,7 +221,7 @@ class AddSolutionForm extends Component {
!description ||
(!file
? false
: validateFileName(file.name) ||
: !validateFileName(file.name) ||
file.size > maxFileSize * 1024 ** 2)
}
inverted
......@@ -282,7 +280,7 @@ class AddSolutionForm extends Component {
!description ||
(!file
? false
: !allowedFileTypes.includes(file.type) ||
: !validateFileName(file.name) ||
file.size > maxFileSize * 1024 ** 2)
}
onClick={() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment