- updated version to 1.0.23, enhance audio file handling, and improve UTC synchronization checks

This commit is contained in:
2026-01-06 12:28:08 +00:00
parent 79e759d811
commit ac9b3cc1ea
8 changed files with 73 additions and 18 deletions

View File

@@ -84,15 +84,23 @@ const SoundUpload = () => {
if (currentUrlRef.current) {
URL.revokeObjectURL(currentUrlRef.current);
}
if (e.target?.files && e.target?.files[0]?.type === "audio/mpeg") {
currentUrlRef.current = URL.createObjectURL(e.target.files[0]);
const files = e.target?.files;
if (
files &&
(files[0]?.type === "audio/mp3" ||
files[0]?.type === "audio/mpeg" ||
files[0]?.name.endsWith(".wav"))
) {
const file = e.target?.files;
if(file === null) return;
currentUrlRef.current = URL.createObjectURL(file[0]);
const url = currentUrlRef.current;
setFieldValue("soundUrl", url);
setFieldValue("name", e.target.files[0].name);
setFieldValue("soundFileName", e.target.files[0].name);
setFieldValue("soundFile", e.target.files[0]);
setFieldValue("name", file[0].name);
setFieldValue("soundFileName", file[0].name);
setFieldValue("soundFile", file[0]);
setFieldValue("uploadedAt", Date.now());
if (e?.target?.files[0]?.size >= 1 * 1024 * 1024) {
if (file[0]?.size >= 1 * 1024 * 1024) {
setFieldError("soundFile", "larger than 1mb");
toast.error("File larger than 1MB");
return;