This commit is contained in:
Will Miao
2025-05-09 15:42:56 +08:00
parent 7b5b4ce082
commit 4793f096af
4 changed files with 436 additions and 187 deletions

View File

@@ -1,4 +1,4 @@
import { createLoraCard } from '../components/LoraCard.js';
import { createLoraCard, setupLoraCardEventDelegation } from '../components/LoraCard.js';
import {
loadMoreModels,
resetAndReload as baseResetAndReload,
@@ -45,6 +45,9 @@ export async function excludeLora(filePath) {
}
export async function loadMoreLoras(resetPage = false, updateFolders = false) {
// Make sure event delegation is set up
setupLoraCardEventDelegation();
return loadMoreModels({
resetPage,
updateFolders,
@@ -70,16 +73,6 @@ export async function replacePreview(filePath) {
return replaceModelPreview(filePath, 'lora');
}
export function appendLoraCards(loras) {
const grid = document.getElementById('loraGrid');
const sentinel = document.getElementById('scroll-sentinel');
loras.forEach(lora => {
const card = createLoraCard(lora);
grid.appendChild(card);
});
}
export async function resetAndReload(updateFolders = false) {
return baseResetAndReload({
updateFolders,