- added sound file size limit

This commit is contained in:
2025-10-30 11:16:06 +00:00
parent 39629897d4
commit a839502421

View File

@@ -72,6 +72,11 @@ const SoundUpload = () => {
setFieldValue("soundFileName", e.target.files[0].name);
setFieldValue("soundFile", e.target.files[0]);
setFieldValue("uploadedAt", Date.now());
if (e?.target?.files[0]?.size >= 1 * 1024 * 1024) {
setFieldError("soundFile", "larger than 1mb");
toast.error("File larger than 1MB");
return;
}
} else {
setFieldError("soundFile", "Not an mp3 file");
toast.error("Not an mp3 file");