Handle zero file size in FileSizeText component

This commit is contained in:
Zagrios
2025-02-22 19:51:21 +01:00
parent a74be4ba9d
commit e7b3ca4fdf
@@ -36,7 +36,7 @@ function FileSizeText({ fileSize, wantInfoStyle }: Readonly<FileSizeProps>) {
const isLargeMod = verifyFileSize && fileSize > 1024 * 1024 * 100; // 100MB
const getFormattedSize = () : string => {
if (!verifyFileSize)
if (!verifyFileSize || fileSize === 0)
return `-`;
if (fileSize < 1024 * 1024)
return `${(fileSize/1024).toFixed(2)}KB`;