mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-10 04:49:24 -03:00
fix(recipe): prevent empty grid by removing preserveScroll from refresh triggers
Bug: when scrolling down on recipes page, any operation with preserveScroll: true would fetch only page 1 data then restore scroll position to beyond the loaded items, leaving the grid empty. Fix: - Remove preserveScroll: true from all 7 must-refresh trigger paths (filter, search, sort, import, settings reload, sync, rebuild cache, sidebar folder nav) - Replace full list refresh with updateSingleItem() for repair and bulk missing-LoRA download operations - Update tests to match new scroll-free behavior
This commit is contained in:
@@ -309,9 +309,22 @@ export class BulkMissingLoraDownloadManager {
|
||||
}, 'warning');
|
||||
}
|
||||
|
||||
// Refresh the recipes list to update LoRA status
|
||||
if (window.recipeManager) {
|
||||
window.recipeManager.loadRecipes({ preserveScroll: true });
|
||||
// Update each affected recipe card with fresh data (LoRA inLibrary flags changed)
|
||||
if (state.virtualScroller) {
|
||||
const { extractRecipeId } = await import('../api/recipeApi.js');
|
||||
for (const recipe of this.pendingRecipes) {
|
||||
const recipeId = extractRecipeId(recipe.file_path);
|
||||
if (!recipeId) continue;
|
||||
try {
|
||||
const detailRes = await fetch(`/api/lm/recipe/${encodeURIComponent(recipeId)}`);
|
||||
if (detailRes.ok) {
|
||||
const updated = await detailRes.json();
|
||||
state.virtualScroller.updateSingleItem(recipe.file_path, updated);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Failed to update recipe card after LoRA download:', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user