fix(lite): ignore a click on the already-connected server

Clicking the Network-tab card of the server the wallet was already
pinned to and connected to tore the controller down and reopened the
wallet against the same server. That click is now a no-op. A wallet that
failed over to another server still reconnects, which retries the pinned
one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 21:09:48 -05:00
co-authored by Claude Opus 5.5
parent 55975901a2
commit 7c24400c83
+6
View File
@@ -10,6 +10,7 @@
#include "../../util/i18n.h"
#include "../../util/lite_server_probe.h"
#include "../../wallet/lite_connection_service.h"
#include "../../wallet/lite_wallet_controller.h"
#include "../theme.h"
#include "../layout.h"
#include "../material/type.h"
@@ -72,6 +73,11 @@ void RenderLiteNetworkTab(App* app)
auto applyAndRebuild = [&]() { st->save(); app->rebuildLiteWallet(/*force=*/true); };
auto pinServer = [&](const std::string& url) {
// Already pinned AND connected to exactly this server: nothing to switch (the click used to tear the
// controller down and reopen). A wallet that failed over to another server still reconnects, which
// retries the pinned one.
auto* lite = app->liteWallet();
if (!randomMode && url == sticky && lite && lite->walletOpen() && lite->connectedServerUrl() == url) return;
st->setLiteServerSelectionMode(LiteMode::Sticky);
st->setLiteStickyServerUrl(url);
applyAndRebuild();