mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-24 22:41:26 -03:00
fix(ui): show empty folders as move and download destinations (#999)
This commit is contained in:
@@ -1206,9 +1206,13 @@ export class BaseModelApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
async fetchUnifiedFolderTree() {
|
||||
async fetchUnifiedFolderTree(options = {}) {
|
||||
try {
|
||||
const response = await fetch(this.apiConfig.endpoints.unifiedFolderTree);
|
||||
const { includeEmpty = false } = options;
|
||||
const url = includeEmpty
|
||||
? `${this.apiConfig.endpoints.unifiedFolderTree}?include_empty=1`
|
||||
: this.apiConfig.endpoints.unifiedFolderTree;
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch unified folder tree`);
|
||||
}
|
||||
|
||||
@@ -2134,8 +2134,9 @@ export class DownloadManager {
|
||||
|
||||
async initializeFolderTree() {
|
||||
try {
|
||||
// Fetch unified folder tree
|
||||
const treeData = await this.apiClient.fetchUnifiedFolderTree();
|
||||
// Fetch unified folder tree, including empty directories so they
|
||||
// can be selected as download destinations
|
||||
const treeData = await this.apiClient.fetchUnifiedFolderTree({ includeEmpty: true });
|
||||
|
||||
if (treeData.success) {
|
||||
// Load tree data into folder tree manager
|
||||
|
||||
@@ -200,8 +200,9 @@ class MoveManager {
|
||||
async initializeFolderTree() {
|
||||
try {
|
||||
const apiClient = this._getApiClient();
|
||||
// Fetch unified folder tree
|
||||
const treeData = await apiClient.fetchUnifiedFolderTree();
|
||||
// Fetch unified folder tree, including empty directories so they
|
||||
// can be selected as move targets
|
||||
const treeData = await apiClient.fetchUnifiedFolderTree({ includeEmpty: true });
|
||||
|
||||
if (treeData.success) {
|
||||
// Load tree data into folder tree manager
|
||||
|
||||
Reference in New Issue
Block a user