From 7c24400c83fcd17265e55c1fdded26f16a0fff36 Mon Sep 17 00:00:00 2001 From: DanS Date: Fri, 9 Oct 2026 21:09:48 -0500 Subject: [PATCH] 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 --- src/ui/windows/network_tab.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui/windows/network_tab.cpp b/src/ui/windows/network_tab.cpp index b12de3a..1672066 100644 --- a/src/ui/windows/network_tab.cpp +++ b/src/ui/windows/network_tab.cpp @@ -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();