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)); } }));