refactor: do not show size for Dir (#447)

This commit is contained in:
freedit-dev 2024-09-06 07:36:15 +08:00 committed by GitHub
parent 2c5cc60965
commit f87c52fda2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -477,6 +477,8 @@ function addPath(file, index) {
${actionDelete}
${actionEdit}
</td>`;
let sizeDisplay = isDir ? "" : formatSize(file.size).join(" ");
$pathsTableBody.insertAdjacentHTML("beforeend", `
<tr id="addPath${index}">
@ -487,7 +489,7 @@ function addPath(file, index) {
<a href="${url}" ${isDir ? "" : `target="_blank"`}>${encodedName}</a>
</td>
<td class="cell-mtime">${formatMtime(file.mtime)}</td>
<td class="cell-size">${formatSize(file.size).join(" ")}</td>
<td class="cell-size">${sizeDisplay}</td>
${actionCell}
</tr>`);
}