update axioserror

This commit is contained in:
Proddy
2022-05-01 13:12:40 +02:00
parent 0143e89e27
commit 6b315d52a8
16 changed files with 55 additions and 31 deletions

View File

@@ -24,13 +24,19 @@ const getBorderColor = (theme: Theme, props: DropzoneState) => {
export interface SingleUploadProps {
onDrop: (acceptedFiles: File[]) => void;
onCancel: () => void;
accept?: string | string[];
uploading: boolean;
progress?: ProgressEvent;
}
const SingleUpload: FC<SingleUploadProps> = ({ onDrop, onCancel, accept, uploading, progress }) => {
const dropzoneState = useDropzone({ onDrop, accept, disabled: uploading, multiple: false });
const SingleUpload: FC<SingleUploadProps> = ({ onDrop, onCancel, uploading, progress }) => {
const dropzoneState = useDropzone({
onDrop,
accept: {
'application/octet-stream': ['.bin']
},
disabled: uploading,
multiple: false
});
const { getRootProps, getInputProps } = dropzoneState;
const theme = useTheme();

View File

@@ -43,7 +43,7 @@ const useFileUpload = ({ upload }: MediaUploadOptions) => {
});
resetUploadingStates();
enqueueSnackbar('Upload successful', { variant: 'success' });
} catch (error: any) {
} catch (error: unknown) {
if (axios.isCancel(error)) {
enqueueSnackbar('Upload aborted', { variant: 'warning' });
} else {