mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat: enhance folder update logic with error handling in fetchModelsPage
This commit is contained in:
@@ -102,8 +102,16 @@ export class BaseModelApiClient {
|
||||
pageState.hasMore = result.hasMore;
|
||||
pageState.currentPage = pageState.currentPage + 1;
|
||||
|
||||
if (updateFolders && result.folders) {
|
||||
updateFolderTags(result.folders);
|
||||
if (updateFolders) {
|
||||
const response = await fetch(this.apiConfig.endpoints.folders);
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
updateFolderTags(data.folders);
|
||||
} else {
|
||||
const errorData = await response.json().catch(() => ({}));
|
||||
const errorMsg = errorData && errorData.error ? errorData.error : response.statusText;
|
||||
console.error(`Error getting folders: ${errorMsg}`);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user