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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user