1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-05 21:58:01 +00:00

Uninstallation experience enhancement

This commit is contained in:
Tw93
2025-11-20 15:15:33 +08:00
parent ab3f8cc129
commit 3ddf2dd3b9
5 changed files with 87 additions and 75 deletions

View File

@@ -136,6 +136,7 @@ batch_uninstall_applications() {
fi
echo -ne "${PURPLE}${ICON_ARROW}${NC} ${removal_note} ${GREEN}Enter${NC} confirm, ${GRAY}ESC${NC} cancel: "
drain_pending_input # Clean up any pending input before confirmation
IFS= read -r -s -n1 key || key=""
drain_pending_input # Clean up any escape sequence remnants
case "$key" in
@@ -316,6 +317,12 @@ batch_uninstall_applications() {
sudo_keepalive_pid=""
fi
# Invalidate cache if any apps were successfully uninstalled
if [[ $success_count -gt 0 ]]; then
local cache_file="$HOME/.cache/mole/app_scan_cache"
rm -f "$cache_file" 2> /dev/null || true
fi
((total_size_cleaned += total_size_freed))
unset failed_items
}