feat: Add and hide loading indicators for tag operations. Fixes #755

This commit is contained in:
Will Miao
2026-01-04 19:12:15 +08:00
parent edbcca9bbd
commit 09c1bd78cd
2 changed files with 6 additions and 0 deletions

View File

@@ -321,6 +321,7 @@ export class BaseModelApiClient {
async addTags(filePath, data) {
try {
state.loadingManager.showSimpleLoading('Adding tags...');
const response = await fetch(this.apiConfig.endpoints.addTags, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
@@ -344,6 +345,8 @@ export class BaseModelApiClient {
} catch (error) {
console.error('Error adding tags:', error);
throw error;
} finally {
state.loadingManager.hide();
}
}

View File

@@ -1026,6 +1026,9 @@ export class BulkManager {
console.error('Error during bulk tag operation:', error);
const toastKey = mode === 'replace' ? 'toast.models.bulkTagsReplaceFailed' : 'toast.models.bulkTagsAddFailed';
showToast(toastKey, {}, 'error');
} finally {
state.loadingManager.hide();
state.loadingManager.restoreProgressBar();
}
}