upload progress changes

This commit is contained in:
proddy
2024-04-26 20:30:02 +02:00
parent 611f37bf2c
commit f2a6b861aa
9 changed files with 55 additions and 41 deletions

View File

@@ -55,18 +55,14 @@ const SingleUpload: FC<SingleUploadProps> = ({
const { LL } = useI18nContext();
const progressText = () => {
console.log(progress);
if (uploading) {
if (progress.total && progress.loaded) {
return progress.loaded <= progress.total
? LL.UPLOADING() +
': ' +
Math.round((progress.loaded * 100) / progress.total) +
'%'
: LL.UPLOADING() +
': ' +
Math.round((progress.total * 100) / progress.loaded) +
'%';
}
return (
LL.UPLOADING() +
': ' +
Math.round((progress.loaded * 100) / progress.total) +
'%'
);
}
return LL.UPLOAD_DROP_TEXT();
};