mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-27 00:36:44 +03:00
friendlySize() could return NaN
This commit is contained in:
parent
306d3ec7b5
commit
2a14566679
2 changed files with 3 additions and 2 deletions
|
|
@ -273,7 +273,8 @@ export const FileInfo = {
|
|||
},
|
||||
|
||||
friendlySize: bytes => {
|
||||
bytes = parseInt(bytes, 10) || 0;
|
||||
bytes = parseInt(bytes, 10);
|
||||
bytes = isFinite(bytes) ? bytes : 0;
|
||||
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];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<div class="control-group">
|
||||
<label data-i18n="MESSAGE_LIST/MENU_SELECT_UNSEEN"></label>
|
||||
<span data-bind="text: unreadEmails"></span>
|
||||
/ <span data-bind="text: totalEmails"></span>
|
||||
/ <span style="margin:0" data-bind="text: totalEmails"></span>
|
||||
</div>
|
||||
<!-- ko if: canBeSubscribed -->
|
||||
<div class="control-group" data-bind="component: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue