diff --git a/src/components/converter/converter-steps/upload-step/upload-step.tsx b/src/components/converter/converter-steps/upload-step/upload-step.tsx index c4c9b49..e9eb3b3 100644 --- a/src/components/converter/converter-steps/upload-step/upload-step.tsx +++ b/src/components/converter/converter-steps/upload-step/upload-step.tsx @@ -73,8 +73,15 @@ const UploadStep = memo(function UploadStepComponent( const onSelectedFormatChange = useCallback( (value: (string | number)[]) => { - setFormat(value[1] as string) - props.updateSelectedExtension(value[1] as string) + const result = value[1] as string + + if (!result) { + console.warn('Could not read selected format.') + return + } + + setFormat(result) + props.updateSelectedExtension(result) }, [props], ) diff --git a/src/model/format.ts b/src/model/format.ts index 9b8c08a..276f95e 100644 --- a/src/model/format.ts +++ b/src/model/format.ts @@ -1,6 +1,7 @@ -/** Defines a format */ +/** Category of a Format */ type FormatCategory = 'Image' | 'Audio' | 'Video' | 'File' +/** Defines a format */ export type Format = { /** Name o the format */ name: string