From b56c63a365b36044fd114ee5a4d08f0fc257d3e8 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Fri, 2 Oct 2026 20:05:27 +0200 Subject: [PATCH] =?UTF-8?q?fix(aegis):=200.25.1=20=E2=80=94=20the=20wallet?= =?UTF-8?q?=20list=20follows=20the=20network=20switch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switching network on the new header chips moved the selected wallet but left the list below it alone. In the addresses drilldown stripView.groupKey pins ":", so the header read chipnet while the rows underneath were still mainnet addresses. The chip now retargets that groupKey when the drilldown belongs to the chain being switched, and leaves a drilldown on any other chain alone. The coins view already keyed off activeNetworkByChain and needed nothing. Switching also lands on whichever wallet that network was last left on instead of the first in list order, which means row clicks have to record that — otherwise picking a wallet, leaving the network and coming back returned somewhere else. --- bundled-addons/aegis/addon.json | 2 +- bundled-addons/aegis/panel.js | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/bundled-addons/aegis/addon.json b/bundled-addons/aegis/addon.json index 59b04733..782a518d 100644 --- a/bundled-addons/aegis/addon.json +++ b/bundled-addons/aegis/addon.json @@ -1,7 +1,7 @@ { "id": "aegis", "name": "Aegis Wallet", - "version": "0.25.0", + "version": "0.25.1", "category": "plugin", "description": "Multi-chain wallet (BCH, BTC, TRX, ETH, SOL, SC, DGB) derived from your Theseus vault. Dapps get window.bitcoincash on .x sites; window.tronWeb / window.tronLink / window.ethereum / window.solana on any https page.", "author": "Silent Mode", diff --git a/bundled-addons/aegis/panel.js b/bundled-addons/aegis/panel.js index 431bf44a..958b3b9d 100644 --- a/bundled-addons/aegis/panel.js +++ b/bundled-addons/aegis/panel.js @@ -512,8 +512,20 @@ function paintNetSelector(s) { // views never disagree about which network this chain is showing. activeNetworkByChain.set(chain, net); persistActiveNetworks(); + // The wallet list has to come along. In the addresses drilldown its + // groupKey pins ":", so without this the header says + // chipnet while the list below keeps showing mainnet addresses. + const subKey = `${chain}:${net}`; + if (stripView.mode === "addresses" && String(stripView.groupKey || "").split(":")[0] === chain) { + stripView = { mode: "addresses", groupKey: subKey }; + } + // Land on whichever wallet this network was last left on, so the header + // switch and the row the strip highlights are the same wallet. + const remembered = activeWalletBySubgroup.get(subKey); + const target = peers.find((w) => w.id === remembered) || peers[0]; + activeWalletBySubgroup.set(subKey, target.id); try { - state = await S.invoke("selectWallet", { id: peers[0].id }); + state = await S.invoke("selectWallet", { id: target.id }); settingsFilled = false; render(); } catch (err) { aegisAlert("Could not switch network: " + cleanErr(err)); } @@ -3148,6 +3160,11 @@ function renderInlineCoinList(el, groupKey, group) { if (e.target.closest(".wact")) return; if (e.target.closest(".wacopy")) return; const id = row.dataset.listpick; + // Record it as this network's current wallet, so switching away on the + // header's network chips and back returns here rather than to whichever + // wallet happens to be first. + const picked = (state?.wallets || []).find((w) => w.id === id); + if (picked) activeWalletBySubgroup.set(`${picked.chain}:${picked.network}`, id); try { state = await S.invoke("selectWallet", { id }); settingsFilled = false; render(); } catch (er) { showErr(cleanErr(er)); } }));