mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 17:30:05 +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
|
UsedPercent float64
|
||||||
SwapUsed uint64
|
SwapUsed uint64
|
||||||
SwapTotal uint64
|
SwapTotal uint64
|
||||||
Cached uint64 // File cache that can be freed if needed
|
Cached uint64 // File cache that can be freed if needed
|
||||||
Pressure string // macOS memory pressure: normal/warn/critical
|
Pressure string // macOS memory pressure: normal/warn/critical
|
||||||
}
|
}
|
||||||
|
|
||||||
type DiskStatus struct {
|
type DiskStatus struct {
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ paginated_multi_select() {
|
|||||||
local top_index=0
|
local top_index=0
|
||||||
local filter_query=""
|
local filter_query=""
|
||||||
local filter_mode="false" # filter mode toggle
|
local filter_mode="false" # filter mode toggle
|
||||||
local sort_mode="${MOLE_MENU_SORT_DEFAULT:-date}" # date|name|size
|
local sort_mode="${MOLE_MENU_SORT_MODE:-${MOLE_MENU_SORT_DEFAULT:-date}}" # date|name|size
|
||||||
local sort_reverse="false"
|
local sort_reverse="${MOLE_MENU_SORT_REVERSE:-false}"
|
||||||
# Live query vs applied query
|
# Live query vs applied query
|
||||||
local applied_query=""
|
local applied_query=""
|
||||||
local searching="false"
|
local searching="false"
|
||||||
@@ -198,6 +198,8 @@ paginated_multi_select() {
|
|||||||
# Cleanup function
|
# Cleanup function
|
||||||
cleanup() {
|
cleanup() {
|
||||||
trap - EXIT INT TERM
|
trap - EXIT INT TERM
|
||||||
|
export MOLE_MENU_SORT_MODE="$sort_mode"
|
||||||
|
export MOLE_MENU_SORT_REVERSE="$sort_reverse"
|
||||||
restore_terminal
|
restore_terminal
|
||||||
unset MOLE_READ_KEY_FORCE_CHAR
|
unset MOLE_READ_KEY_FORCE_CHAR
|
||||||
}
|
}
|
||||||
@@ -895,6 +897,8 @@ paginated_multi_select() {
|
|||||||
|
|
||||||
trap - EXIT INT TERM
|
trap - EXIT INT TERM
|
||||||
MOLE_SELECTION_RESULT="$final_result"
|
MOLE_SELECTION_RESULT="$final_result"
|
||||||
|
export MOLE_MENU_SORT_MODE="$sort_mode"
|
||||||
|
export MOLE_MENU_SORT_REVERSE="$sort_reverse"
|
||||||
restore_terminal
|
restore_terminal
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user