- fixed file size bug

This commit is contained in:
2025-10-28 15:23:28 +00:00
parent c8eed55801
commit cf72a1e1d3

View File

@@ -65,7 +65,7 @@ const SoundUpload = () => {
className="mt-4 w-full flex flex-col items-center justify-center rounded-2xl border border-slate-800 bg-slate-900/40 p-10 text-center file:px-3 file:border file:border-gray-500 file:rounded-lg file:bg-blue-800 file:mr-5"
onChange={(e) => {
if (e.target?.files && e.target?.files[0]?.type === "audio/mpeg") {
if (e.target.files[0].size / (1024 * 1024) <= 1) {
if (e.target.files[0].size / (1024 * 1024) >= 1) {
toast.error("File is too large. Max size is 1MB");
return;
}