Enhance model deletion handling in UI: integrate virtual scroller updates and remove legacy UI card removal logic.

This commit is contained in:
Will Miao
2025-05-13 17:50:28 +08:00
parent 3e06938b05
commit 84bfad7ce5
4 changed files with 76 additions and 15 deletions

View File

@@ -28,8 +28,6 @@ export function showDeleteModal(filePath, modelType = 'lora') {
export async function confirmDelete() {
if (!pendingDeletePath) return;
const card = document.querySelector(`.lora-card[data-filepath="${pendingDeletePath}"]`);
try {
// Use appropriate delete function based on model type
if (pendingModelType === 'checkpoint') {
@@ -37,10 +35,7 @@ export async function confirmDelete() {
} else {
await deleteLora(pendingDeletePath);
}
if (card) {
card.remove();
}
closeDeleteModal();
} catch (error) {
console.error('Error deleting model:', error);