1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 17:24:45 +00:00

Merge pull request #236 from jimmystridh/fix/preserve-sort-state-after-uninstall

fix(ui): preserve sort state after uninstall
This commit is contained in:
Tw93
2026-01-03 13:57:28 +08:00
committed by GitHub
2 changed files with 8 additions and 4 deletions

View File

@@ -84,8 +84,8 @@ type MemoryStatus struct {
UsedPercent float64
SwapUsed uint64
SwapTotal uint64
Cached uint64 // File cache that can be freed if needed
Pressure string // macOS memory pressure: normal/warn/critical
Cached uint64 // File cache that can be freed if needed
Pressure string // macOS memory pressure: normal/warn/critical
}
type DiskStatus struct {

View File

@@ -89,8 +89,8 @@ paginated_multi_select() {
local top_index=0
local filter_query=""
local filter_mode="false" # filter mode toggle
local sort_mode="${MOLE_MENU_SORT_DEFAULT:-date}" # date|name|size
local sort_reverse="false"
local sort_mode="${MOLE_MENU_SORT_MODE:-${MOLE_MENU_SORT_DEFAULT:-date}}" # date|name|size
local sort_reverse="${MOLE_MENU_SORT_REVERSE:-false}"
# Live query vs applied query
local applied_query=""
local searching="false"
@@ -198,6 +198,8 @@ paginated_multi_select() {
# Cleanup function
cleanup() {
trap - EXIT INT TERM
export MOLE_MENU_SORT_MODE="$sort_mode"
export MOLE_MENU_SORT_REVERSE="$sort_reverse"
restore_terminal
unset MOLE_READ_KEY_FORCE_CHAR
}
@@ -895,6 +897,8 @@ paginated_multi_select() {
trap - EXIT INT TERM
MOLE_SELECTION_RESULT="$final_result"
export MOLE_MENU_SORT_MODE="$sort_mode"
export MOLE_MENU_SORT_REVERSE="$sort_reverse"
restore_terminal
return 0
;;