From 2a14566679e08bd2c4fe9b2676484dcd091dbc4a Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 13 Feb 2024 10:50:31 +0100 Subject: [PATCH] friendlySize() could return NaN --- dev/Common/File.js | 3 ++- snappymail/v/0.0.0/app/templates/Views/User/PopupsFolder.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/Common/File.js b/dev/Common/File.js index 7ae281a20..f1ced6ff4 100644 --- a/dev/Common/File.js +++ b/dev/Common/File.js @@ -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]; } diff --git a/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolder.html b/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolder.html index eca283096..0d932518c 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolder.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolder.html @@ -17,7 +17,7 @@
- / + /