diff --git a/src/ui/windows/wallets_dialog.h b/src/ui/windows/wallets_dialog.h index af36472..9666759 100644 --- a/src/ui/windows/wallets_dialog.h +++ b/src/ui/windows/wallets_dialog.h @@ -155,7 +155,10 @@ public: default: sortVal[k] = pr.createdEpoch; break; // 0 = date created } } + auto isActive = [&](std::size_t i) { return s_rows[i].inDatadir && s_rows[i].fileName == active; }; std::stable_sort(s_order.begin(), s_order.end(), [&](std::size_t a, std::size_t b) { + const bool aa = isActive(a), ba = isActive(b); + if (aa != ba) return aa; // the active wallet is always pinned to the top return s_sortDesc ? sortVal[a] > sortVal[b] : sortVal[a] < sortVal[b]; }); }