mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 06:32:12 -03:00
Fix layout
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
import { state } from '../state/index.js';
|
||||
import { loadMoreLoras } from '../api/loraApi.js';
|
||||
import { debounce } from './debounce.js';
|
||||
|
||||
export function initializeInfiniteScroll() {
|
||||
if (state.observer) {
|
||||
state.observer.disconnect();
|
||||
}
|
||||
|
||||
const debouncedLoadMore = debounce(loadMoreLoras, 200);
|
||||
|
||||
state.observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
const target = entries[0];
|
||||
if (target.isIntersecting && !state.isLoading && state.hasMore) {
|
||||
loadMoreLoras();
|
||||
debouncedLoadMore();
|
||||
}
|
||||
},
|
||||
{ threshold: 0.1 }
|
||||
|
||||
Reference in New Issue
Block a user