diff --git a/src/client/src/pages/detail/attachments/fileDropzone.jsx b/src/client/src/pages/detail/attachments/fileDropzone.jsx index 5f75768b9..13b74de42 100644 --- a/src/client/src/pages/detail/attachments/fileDropzone.jsx +++ b/src/client/src/pages/detail/attachments/fileDropzone.jsx @@ -88,12 +88,14 @@ export const FileDropzone = props => { setDropZoneTextColor(defaultDropzoneTextColor); setDropZoneText(t(defaultText)); setFiles(prevFiles => [...prevFiles, ...acceptedFiles]); - // set filetype depending on acceptedFileTypes. if contains csv - if (acceptedFileTypes.includes("text/csv")) { - setFileType("csv"); - } - if (acceptedFileTypes.includes("application/json")) { - setFileType("json"); + + if (setFileType) { + if (acceptedFileTypes.includes("text/csv")) { + setFileType("csv"); + } + if (acceptedFileTypes.includes("application/json")) { + setFileType("json"); + } } } }, @@ -112,7 +114,9 @@ export const FileDropzone = props => { // Is called when an accepted file is removed. const removeFile = fileToRemove => { setFiles(prevFiles => prevFiles.filter(file => file !== fileToRemove)); - setFileType(null); + if (setFileType) { + setFileType(null); + } }; // Is called when the selected/dropped files are rejected diff --git a/src/client/src/pages/detail/form/borehole/geometryImport.jsx b/src/client/src/pages/detail/form/borehole/geometryImport.jsx index 74c12fe14..ca2879de2 100644 --- a/src/client/src/pages/detail/form/borehole/geometryImport.jsx +++ b/src/client/src/pages/detail/form/borehole/geometryImport.jsx @@ -114,7 +114,7 @@ const GeometryImport = ({ boreholeId }) => {