mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 07:05:43 -03:00
refactor: conditionally initialize managers in HeaderManager to avoid unnecessary setup on statistics page
This commit is contained in:
@@ -16,7 +16,9 @@ export class HeaderManager {
|
|||||||
this.filterManager = null;
|
this.filterManager = null;
|
||||||
|
|
||||||
// Initialize appropriate managers based on current page
|
// Initialize appropriate managers based on current page
|
||||||
this.initializeManagers();
|
if (this.currentPage !== 'statistics') {
|
||||||
|
this.initializeManagers();
|
||||||
|
}
|
||||||
|
|
||||||
// Set up common header functionality
|
// Set up common header functionality
|
||||||
this.initializeCommonElements();
|
this.initializeCommonElements();
|
||||||
@@ -37,11 +39,8 @@ export class HeaderManager {
|
|||||||
this.searchManager = new SearchManager({ page: this.currentPage });
|
this.searchManager = new SearchManager({ page: this.currentPage });
|
||||||
window.searchManager = this.searchManager;
|
window.searchManager = this.searchManager;
|
||||||
|
|
||||||
// Initialize FilterManager for all page types that have filters
|
this.filterManager = new FilterManager({ page: this.currentPage });
|
||||||
if (document.getElementById('filterButton')) {
|
window.filterManager = this.filterManager;
|
||||||
this.filterManager = new FilterManager({ page: this.currentPage });
|
|
||||||
window.filterManager = this.filterManager;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeCommonElements() {
|
initializeCommonElements() {
|
||||||
|
|||||||
Reference in New Issue
Block a user