mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 15:15:44 -03:00
feat: Add and hide loading indicators for tag operations. Fixes #755
This commit is contained in:
@@ -321,6 +321,7 @@ export class BaseModelApiClient {
|
|||||||
|
|
||||||
async addTags(filePath, data) {
|
async addTags(filePath, data) {
|
||||||
try {
|
try {
|
||||||
|
state.loadingManager.showSimpleLoading('Adding tags...');
|
||||||
const response = await fetch(this.apiConfig.endpoints.addTags, {
|
const response = await fetch(this.apiConfig.endpoints.addTags, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
@@ -344,6 +345,8 @@ export class BaseModelApiClient {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error adding tags:', error);
|
console.error('Error adding tags:', error);
|
||||||
throw error;
|
throw error;
|
||||||
|
} finally {
|
||||||
|
state.loadingManager.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1026,6 +1026,9 @@ export class BulkManager {
|
|||||||
console.error('Error during bulk tag operation:', error);
|
console.error('Error during bulk tag operation:', error);
|
||||||
const toastKey = mode === 'replace' ? 'toast.models.bulkTagsReplaceFailed' : 'toast.models.bulkTagsAddFailed';
|
const toastKey = mode === 'replace' ? 'toast.models.bulkTagsReplaceFailed' : 'toast.models.bulkTagsAddFailed';
|
||||||
showToast(toastKey, {}, 'error');
|
showToast(toastKey, {}, 'error');
|
||||||
|
} finally {
|
||||||
|
state.loadingManager.hide();
|
||||||
|
state.loadingManager.restoreProgressBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user