Przeglądaj źródła

WebClient: fix icon for 0 byte files

Signed-off-by: Nicola Murino <[email protected]>
Nicola Murino 2 lat temu
rodzic
commit
daf643596d

+ 2 - 2
templates/webclient/files.html

@@ -1258,7 +1258,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
                             if (row["type"] == "1") {
                                 return `<i class="fas fa-folder"></i>&nbsp;<a class="${cssClass}" href="${row['url']}" title="${title}">${shortened}</a>`;
                             }
-                            if (row["size"] == "") {
+                            if (row["size"] === "") {
                                 return `<i class="fas fa-external-link-alt"></i>&nbsp;<a class="${cssClass}" href="${row['url']}" title="${title}">${shortened}</a>`;
                             }
                             let icon = getIconForFile(data);
@@ -1271,7 +1271,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
                     "data": "size",
                     "render": function (data, type, row) {
                         if (type === 'display') {
-                            if (data){
+                            if (data || data === 0){
                                 return fileSizeIEC(data);
                             }
                             return "";

+ 2 - 2
templates/webclient/sharefiles.html

@@ -490,7 +490,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
                             if (row["type"] == "1") {
                                 return `<i class="fas fa-folder"></i>&nbsp;<a class="${cssClass}" href="${row['url']}" title="${title}">${shortened}</a>`;
                             }
-                            if (row["size"] == "") {
+                            if (row["size"] === "") {
                                 return `<i class="fas fa-external-link-alt"></i>&nbsp;<a class="${cssClass}" href="${row['url']}" title="${title}">${shortened}</a>`;
                             }
                             var icon = getIconForFile(data);
@@ -503,7 +503,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
                     "data": "size",
                     "render": function (data, type, row) {
                         if (type === 'display') {
-                            if (data){
+                            if (data || data === 0){
                                 return fileSizeIEC(data);
                             }
                             return "";