1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 14:26:46 +00:00

fix(analyze): clear multi-select on refresh and optimize delete

- Clear multi-selection map on refresh to prevent index mismatch
- Use built-in min function in delete.go
- Improve delete cancellation logic
This commit is contained in:
Tw93
2025-12-21 22:10:56 +08:00
parent 74d05ed9aa
commit e13d92abc0
2 changed files with 4 additions and 7 deletions

View File

@@ -63,13 +63,6 @@ func (e *multiDeleteError) Error() string {
return strings.Join(e.errors[:min(3, len(e.errors))], "; ")
}
func min(a, b int) int {
if a < b {
return a
}
return b
}
func deletePathWithProgress(root string, counter *int64) (int64, error) {
var count int64
var firstErr error

View File

@@ -681,6 +681,10 @@ func (m model) updateKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
m.scanning = false
return m, nil
case "r":
// Clear multi-selection on refresh
m.multiSelected = make(map[int]bool)
m.largeMultiSelected = make(map[int]bool)
if m.inOverviewMode() {
// In overview mode, clear cache and re-scan known entries
m.overviewSizeCache = make(map[string]int64)