feat: add placeholder for empty folder tree in download modal

This commit is contained in:
Will Miao
2025-08-13 23:45:37 +08:00
parent 8d01d04ef0
commit 52e3ad08c1
2 changed files with 13 additions and 2 deletions

View File

@@ -351,8 +351,8 @@
display: flex;
gap: 8px;
margin-left: 20px;
margin-top: 4px;
align-items: center;
height: 21px;
}
.create-folder-form input {

View File

@@ -175,7 +175,18 @@ export class FolderTreeManager {
renderTree() {
const folderTree = document.getElementById(this.getElementId('folderTree'));
if (!folderTree) return;
// Show placeholder if treeData is empty
if (!this.treeData || Object.keys(this.treeData).length === 0) {
folderTree.innerHTML = `
<div class="folder-tree-placeholder" style="padding:24px;text-align:center;color:var(--text-color);opacity:0.7;">
<i class="fas fa-folder-open" style="font-size:2em;opacity:0.5;"></i>
<div>No folders found.<br/>You can create a new folder using the button above.</div>
</div>
`;
return;
}
folderTree.innerHTML = this.renderTreeNode(this.treeData, '');
}