From daf643596d2c3ded925fc0befee61ac87edaf222 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sun, 29 Oct 2023 08:27:00 +0100 Subject: [PATCH] WebClient: fix icon for 0 byte files Signed-off-by: Nicola Murino --- templates/webclient/files.html | 4 ++-- templates/webclient/sharefiles.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/webclient/files.html b/templates/webclient/files.html index b7d733c8..d5f4cc93 100644 --- a/templates/webclient/files.html +++ b/templates/webclient/files.html @@ -1258,7 +1258,7 @@ along with this program. If not, see . if (row["type"] == "1") { return ` ${shortened}`; } - if (row["size"] == "") { + if (row["size"] === "") { return ` ${shortened}`; } let icon = getIconForFile(data); @@ -1271,7 +1271,7 @@ along with this program. If not, see . "data": "size", "render": function (data, type, row) { if (type === 'display') { - if (data){ + if (data || data === 0){ return fileSizeIEC(data); } return ""; diff --git a/templates/webclient/sharefiles.html b/templates/webclient/sharefiles.html index 149cc4e7..a49427da 100644 --- a/templates/webclient/sharefiles.html +++ b/templates/webclient/sharefiles.html @@ -490,7 +490,7 @@ along with this program. If not, see . if (row["type"] == "1") { return ` ${shortened}`; } - if (row["size"] == "") { + if (row["size"] === "") { return ` ${shortened}`; } var icon = getIconForFile(data); @@ -503,7 +503,7 @@ along with this program. If not, see . "data": "size", "render": function (data, type, row) { if (type === 'display') { - if (data){ + if (data || data === 0){ return fileSizeIEC(data); } return "";