feat: update preview URL handling in RecipeRoutes and optimize recipe refresh logic in RecipeModal. Fixes #244

This commit is contained in:
Will Miao
2025-06-23 15:29:22 +08:00
parent e726c4f442
commit f6ef428008
2 changed files with 5 additions and 8 deletions

View File

@@ -1373,7 +1373,7 @@ class RecipeRoutes:
json.dump(recipe_data, f, indent=4, ensure_ascii=False)
updated_lora['inLibrary'] = True
updated_lora['preview_url'] = target_lora['preview_url']
updated_lora['preview_url'] = config.get_preview_static_url(target_lora['preview_url'])
updated_lora['localPath'] = target_lora['file_path']
# Update in cache if it exists

View File

@@ -989,13 +989,10 @@ class RecipeModal {
setTimeout(() => {
this.showRecipeDetails(this.currentRecipe);
}, 500);
// Refresh recipes list
if (window.recipeManager && typeof window.recipeManager.loadRecipes === 'function') {
setTimeout(() => {
window.recipeManager.loadRecipes(true);
}, 1000);
}
state.virtualScroller.updateSingleItem(this.currentRecipe.file_path, {
loras: this.currentRecipe.loras
});
} else {
showToast(`Error: ${result.error}`, 'error');
}