Add props.onImageChange check in the slider change description handler

This commit is contained in:
kvakazyambra 2023-11-10 01:21:09 +03:00
parent fedcfea23f
commit 46db039ced

View File

@ -46,7 +46,9 @@ export const ImageSwiper = (props: Props) => {
} = useSnackbar() } = useSnackbar()
const handleSlideDescriptionChange = (index: number, field: string, value) => { const handleSlideDescriptionChange = (index: number, field: string, value) => {
props.onImageChange(index, { ...props.images[index], [field]: value }) if (props.onImageChange) {
props.onImageChange(index, { ...props.images[index], [field]: value })
}
} }
const swipeToUploaded = () => { const swipeToUploaded = () => {
setTimeout(() => { setTimeout(() => {