mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
Bugfix: friendlySize() failed on 0
This commit is contained in:
parent
ec111defbb
commit
905315b164
|
@ -274,7 +274,7 @@ export const FileInfo = {
|
|||
|
||||
friendlySize: bytes => {
|
||||
bytes = parseInt(bytes, 10) || 0;
|
||||
let i = Math.floor(Math.log(bytes) / Math.log(1024));
|
||||
let i = bytes ? Math.floor(Math.log(bytes) / Math.log(1024)) : 0;
|
||||
return (bytes / Math.pow(1024, i)).toFixed(2>i ? 0 : 1) + ' ' + sizes[i];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue