Fix: 업로드 퍼센트 복구

This commit is contained in:
정현조 2024-10-08 09:52:00 +09:00
parent 04c693c49c
commit 7848a3cc8e

View File

@ -148,8 +148,7 @@ export default function ImagePreSignedForm({
onProgress: (progress) => { onProgress: (progress) => {
setUploadStatus((prevStatus) => { setUploadStatus((prevStatus) => {
const completedFiles = Math.round((progress / 100) * files.length); const completedFiles = Math.round((progress / 100) * files.length);
const newStatus = prevStatus.map((status, index) => (index < completedFiles ? 'success' : status)); return prevStatus.map((status, index) => (index < completedFiles ? 'success' : status));
return newStatus;
}); });
}, },
useSingleUpload: uploadType === 'file', useSingleUpload: uploadType === 'file',
@ -166,7 +165,7 @@ export default function ImagePreSignedForm({
} }
}; };
const totalProgress = Math.round((uploadStatus.filter((status) => status !== null).length / files.length) * 100); const totalProgress = Math.round((uploadStatus.filter((status) => status === 'success').length / files.length) * 100);
useEffect(() => { useEffect(() => {
onFileCount(files.length); onFileCount(files.length);