mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-23 14:12:11 -03:00
Refactor RecipeManager and ImportManager for improved functionality
- Removed deprecated global functions from RecipeManager to streamline the API and enhance clarity. - Updated the import handling in ImportManager to directly call loadRecipes on the RecipeManager, ensuring better integration. - Adjusted the recipes.html template to utilize the ImportManager for showing the import modal, improving code consistency.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { modalManager } from './ModalManager.js';
|
||||
import { showToast } from '../utils/uiHelpers.js';
|
||||
import { LoadingManager } from './LoadingManager.js';
|
||||
import { state } from '../state/index.js';
|
||||
import { resetAndReload } from '../api/loraApi.js';
|
||||
|
||||
export class ImportManager {
|
||||
constructor() {
|
||||
@@ -922,13 +920,7 @@ export class ImportManager {
|
||||
// Close modal and reload recipes
|
||||
modalManager.closeModal('importModal');
|
||||
|
||||
// Refresh the recipe list if needed
|
||||
if (typeof refreshRecipes === 'function') {
|
||||
refreshRecipes();
|
||||
} else {
|
||||
// Fallback to reloading the page
|
||||
resetAndReload();
|
||||
}
|
||||
window.recipeManager.loadRecipes(true); // true to reset pagination
|
||||
|
||||
} else {
|
||||
// Handle error
|
||||
|
||||
@@ -308,7 +308,6 @@ export class SearchManager {
|
||||
|
||||
// Call the appropriate manager's load method based on page type
|
||||
if (this.currentPage === 'recipes' && window.recipeManager) {
|
||||
console.log("load recipes")
|
||||
window.recipeManager.loadRecipes(true); // true to reset pagination
|
||||
} else if (this.currentPage === 'loras' && window.loadMoreLoras) {
|
||||
// Reset loras page and reload
|
||||
|
||||
Reference in New Issue
Block a user