(selectedParent, elementId = 'model-parent')
| 15712 | let confirm; |
| 15713 | try { |
| 15714 | confirm = await window.electron.showMessage( |
| 15715 | 'Confirm Delete', |
| 15716 | `Are you sure you want to DELETE ${selectedFiles.length} files?\nThis cannot be undone!\n\nFiles:\n${fileList}${moreFiles}`, |
| 15717 | ['Yes', 'No'] |
| 15718 | ); |
| 15719 | } finally { |
| 15720 | // Reset flag after confirmation dialog closes (whether Yes or No) |
| 15721 | isDeletingDuplicates = false; |
| 15722 | } |
| 15723 | |
| 15724 | if (confirm === 'Yes') { |
| 15725 | try { |
| 15726 | for (const filePath of selectedFiles) { |
| 15727 | console.log('Attempting to delete:', filePath); |
| 15728 | const success = await window.electron.deleteFile(filePath); |
| 15729 | console.log('Delete result:', success); |
| 15730 | if (!success) { |
| 15731 | await window.electron.showMessage('Error', `Failed to delete file: ${filePath}`); |
| 15732 | } |
| 15733 | } |
| 15734 | |
| 15735 | const dialog = document.getElementById('dedup-dialog'); |
| 15736 | // Keep dialog open: refresh grid in background, then refresh duplicate list in place until user clicks Close |
| 15737 | selectedModels.clear(); |
| 15738 | |
| 15739 | // Refresh the main grid (non-blocking feel: don't await before refreshing de-dupe list) |
| 15740 | const sortSelect = document.getElementById('sort-select'); |
| 15741 | window.electron.getAllModels(sortSelect ? sortSelect.value : 'date-desc').then(models => { |
| 15742 | renderFiles(models); |
| 15743 | }); |
no outgoing calls
no test coverage detected