mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-22 05:32:12 -03:00
feat(localization): update toast messages for consistency and improved error handling across various components
This commit is contained in:
@@ -418,7 +418,7 @@ export class DownloadManager {
|
||||
const config = this.apiClient.apiConfig.config;
|
||||
|
||||
if (!modelRoot) {
|
||||
showToast('models.pleaseSelectRoot', { type: config.displayName }, 'error');
|
||||
showToast('toast.models.pleaseSelectRoot', { type: config.displayName }, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ class ExampleImagesManager {
|
||||
// Close settings modal
|
||||
modalManager.closeModal('settingsModal');
|
||||
} else {
|
||||
showToast('exampleImages.downloadStartFailed', { error: data.error }, 'error');
|
||||
showToast('toast.exampleImages.downloadStartFailed', { error: data.error }, 'error');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to start download:', error);
|
||||
@@ -321,7 +321,7 @@ class ExampleImagesManager {
|
||||
this.updateDownloadButtonText();
|
||||
showToast('toast.exampleImages.downloadPaused', {}, 'info');
|
||||
} else {
|
||||
showToast('exampleImages.pauseFailed', { error: data.error }, 'error');
|
||||
showToast('toast.exampleImages.pauseFailed', { error: data.error }, 'error');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to pause download:', error);
|
||||
@@ -357,7 +357,7 @@ class ExampleImagesManager {
|
||||
this.updateDownloadButtonText();
|
||||
showToast('toast.exampleImages.downloadResumed', {}, 'success');
|
||||
} else {
|
||||
showToast('exampleImages.resumeFailed', { error: data.error }, 'error');
|
||||
showToast('toast.exampleImages.resumeFailed', { error: data.error }, 'error');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to resume download:', error);
|
||||
|
||||
@@ -77,7 +77,7 @@ export class DownloadManager {
|
||||
if (!result.success) {
|
||||
// Handle save error
|
||||
console.error("Failed to save recipe:", result.error);
|
||||
showToast('import.recipeSaveFailed', { error: result.error }, 'error');
|
||||
showToast('toast.import.recipeSaveFailed', { error: result.error }, 'error');
|
||||
// Close modal
|
||||
modalManager.closeModal('importModal');
|
||||
return;
|
||||
@@ -107,7 +107,7 @@ export class DownloadManager {
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
showToast('import.processingError', { message: error.message }, 'error');
|
||||
showToast('toast.import.processingError', { message: error.message }, 'error');
|
||||
} finally {
|
||||
this.importManager.loadingManager.hide();
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ export class FolderBrowser {
|
||||
this.initializeFolderBrowser();
|
||||
} catch (error) {
|
||||
console.error('Error in API calls:', error);
|
||||
showToast('import.folderBrowserError', { message: error.message }, 'error');
|
||||
showToast('toast.import.folderBrowserError', { message: error.message }, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user