mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-25 15:01:27 -03:00
fix(ui): reload listing when an invalid folder selection falls back to root
After a drag move empties the selected folder, refresh() resets the stale activeFolder to root but the grid kept showing the old filtered (empty) view until a manual reload. Trigger resetAndReload when the fallback happens post-initialization; the initial page load is untouched because it picks up the cleared filter on its own.
This commit is contained in:
@@ -1841,6 +1841,16 @@ export class SidebarManager {
|
||||
this.pageControls.pageState.activeFolder = '';
|
||||
}
|
||||
setStorageItem(`${this.pageType}_activeFolder`, '');
|
||||
// When the reset happens after initialization (e.g. via
|
||||
// refresh() after a drag move emptied the folder), reload the
|
||||
// listing so the grid shows the root contents instead of
|
||||
// staying empty. Skipped during initialize() — the first load
|
||||
// picks up the cleared filter on its own.
|
||||
if (this.isInitialized && typeof this.pageControls?.resetAndReload === 'function') {
|
||||
this.pageControls.resetAndReload().catch((error) => {
|
||||
console.error('Failed to reload after resetting folder selection:', error);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.selectedPath = activeFolder;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user