mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-05-06 16:36:45 -03:00
fix(recipes): preserve scroll on in-place reloads
This commit is contained in:
@@ -328,16 +328,32 @@ class RecipeManager {
|
||||
});
|
||||
}
|
||||
|
||||
normalizeLoadRecipesOptions(options = true) {
|
||||
if (typeof options === 'boolean') {
|
||||
return {
|
||||
resetPage: options,
|
||||
preserveScroll: false
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
resetPage: options?.resetPage !== false,
|
||||
preserveScroll: options?.preserveScroll === true
|
||||
};
|
||||
}
|
||||
|
||||
// This method is kept for compatibility but now uses virtual scrolling
|
||||
async loadRecipes(resetPage = true) {
|
||||
async loadRecipes(options = true) {
|
||||
// Skip loading if in duplicates mode
|
||||
const pageState = getCurrentPageState();
|
||||
if (pageState.duplicatesMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { resetPage, preserveScroll } = this.normalizeLoadRecipesOptions(options);
|
||||
|
||||
if (resetPage) {
|
||||
refreshVirtualScroll();
|
||||
await refreshVirtualScroll({ preserveScroll });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user