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

Fix the problem of calculating the size after deletion

This commit is contained in:
Tw93
2025-11-20 20:10:17 +08:00
parent 11b8a4d03c
commit 6e9f4ac63d
2 changed files with 14 additions and 0 deletions

View File

@@ -399,6 +399,13 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
// Refresh the view
m.scanning = true
// Reset scan counters for rescan
atomic.StoreInt64(m.filesScanned, 0)
atomic.StoreInt64(m.dirsScanned, 0)
atomic.StoreInt64(m.bytesScanned, 0)
if m.currentPath != nil {
*m.currentPath = ""
}
return m, tea.Batch(m.scanCmd(m.path), tickCmd())
}
}
@@ -614,6 +621,13 @@ func (m model) updateKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
case "r":
m.status = "Refreshing..."
m.scanning = true
// Reset scan counters for refresh
atomic.StoreInt64(m.filesScanned, 0)
atomic.StoreInt64(m.dirsScanned, 0)
atomic.StoreInt64(m.bytesScanned, 0)
if m.currentPath != nil {
*m.currentPath = ""
}
return m, tea.Batch(m.scanCmd(m.path), tickCmd())
case "l":
m.showLargeFiles = !m.showLargeFiles