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