chore(aegis): 0.9.4 — merge the coins-row buttons too
0.9.3 merged ✎ and 🗑 into one ⋯ in the coin drilldown but left the coins summary row with the old pair, so the two views disagreed about the same idea. Both now carry a single ⋯ opening the manage modal. Found by rendering the panel against stubbed host state over HTTP rather than reading the diff — the file:// preview never executes panel.js, so earlier checks could only confirm the markup existed, not that it drew correctly. Drops the now-unreachable removeWalletWithConfirm helper, the data-wremove handler and the .wactdel style that went with them.
This commit is contained in:
parent
4956f8f6c1
commit
e9335f5e6b
3 changed files with 9 additions and 39 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "aegis",
|
"id": "aegis",
|
||||||
"name": "Aegis Wallet",
|
"name": "Aegis Wallet",
|
||||||
"version": "0.9.3",
|
"version": "0.9.4",
|
||||||
"category": "plugin",
|
"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.",
|
"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",
|
"author": "Silent Mode",
|
||||||
|
|
|
||||||
|
|
@ -453,9 +453,6 @@
|
||||||
.wstrip .warow .wact { background: transparent; border: 0; color: var(--dim); cursor: pointer;
|
.wstrip .warow .wact { background: transparent; border: 0; color: var(--dim); cursor: pointer;
|
||||||
padding: 2px 5px; border-radius: 4px; font-size: 12.5px; line-height: 1; }
|
padding: 2px 5px; border-radius: 4px; font-size: 12.5px; line-height: 1; }
|
||||||
.wstrip .warow .wact:hover { color: var(--acid, #d6ff3d); background: rgba(255,255,255,.06); }
|
.wstrip .warow .wact:hover { color: var(--acid, #d6ff3d); background: rgba(255,255,255,.06); }
|
||||||
/* Destructive strip action (remove wallet). Stays quiet until hovered so
|
|
||||||
a row of icons doesn't read as a row of warnings. */
|
|
||||||
.wstrip .wact.wactdel:hover { color: var(--danger, #f6768a); background: rgb(from var(--danger, #f6768a) r g b / .12); }
|
|
||||||
/* Per-address asset list (0.8.8). The count chip expands the row into a
|
/* Per-address asset list (0.8.8). The count chip expands the row into a
|
||||||
nested list of what that ONE address holds beyond the native coin. */
|
nested list of what that ONE address holds beyond the native coin. */
|
||||||
.wstrip .waassets { background: rgba(255,255,255,.06); border: 0; color: var(--dim); cursor: pointer;
|
.wstrip .waassets { background: rgba(255,255,255,.06); border: 0; color: var(--dim); cursor: pointer;
|
||||||
|
|
|
||||||
|
|
@ -895,29 +895,6 @@ function aegisAlert(message, opts) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shared remove-wallet flow, used by the strip's 🗑 buttons and the coin
|
|
||||||
// drilldown. Confirms first, then unlinks. On-chain funds are untouched —
|
|
||||||
// this only drops Aegis's record of the wallet.
|
|
||||||
async function removeWalletWithConfirm(id) {
|
|
||||||
const w = (state?.wallets || []).find((x) => x.id === id);
|
|
||||||
if (!w) return false;
|
|
||||||
if (w.isDefault || w.isLegacy) {
|
|
||||||
await aegisAlert("This is the default wallet — it holds legacy funds and can't be removed.", { title: "Can't remove", icon: "🔒" });
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const ok = await aegisConfirm({
|
|
||||||
title: `Remove "${w.label}"?`,
|
|
||||||
danger: true,
|
|
||||||
confirmLabel: "Remove wallet",
|
|
||||||
body: `On-chain funds stay exactly where they are — this only unlinks the wallet from Aegis.<br><br>You can add it back later on the same coin + network to derive the same addresses ${w.kind === "imported" ? "(or re-import it, since this one was imported)" : "from your vault seed"}.`,
|
|
||||||
});
|
|
||||||
if (!ok) return false;
|
|
||||||
state = await S.invoke("removeWallet", { id });
|
|
||||||
settingsFilled = false;
|
|
||||||
render();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Import modal — M.1 UX. Paste mnemonic + path OR WIF, choose network + label
|
// Import modal — M.1 UX. Paste mnemonic + path OR WIF, choose network + label
|
||||||
// + category. Backend derives cashaddr and stores signer material in
|
// + category. Backend derives cashaddr and stores signer material in
|
||||||
// wallet-imports.enc (design §3.2). Modal is a plain overlay div injected
|
// wallet-imports.enc (design §3.2). Modal is a plain overlay div injected
|
||||||
|
|
@ -2230,12 +2207,15 @@ function renderWalletStrip() {
|
||||||
// and opened the global Settings tab — the same destination for every
|
// and opened the global Settings tab — the same destination for every
|
||||||
// coin, so it read as a per-coin control that wasn't one. Removing a
|
// coin, so it read as a per-coin control that wasn't one. Removing a
|
||||||
// wallet is the action people actually wanted there.
|
// wallet is the action people actually wanted there.
|
||||||
const editAttr = `data-wedit="${esc(walletId)}"`;
|
// Same single-⋯ shape as the drilldown row: one control for "change
|
||||||
|
// this wallet", opening the manage modal that already holds rename,
|
||||||
|
// derivation path and remove. 0.9.3 merged the drilldown but left
|
||||||
|
// this row with the old ✎ + 🗑 pair, so the two views disagreed.
|
||||||
const activeW = gw.find((w) => w.id === walletId);
|
const activeW = gw.find((w) => w.id === walletId);
|
||||||
const canRemove = !(activeW?.isDefault || activeW?.isLegacy);
|
const canRemove = !(activeW?.isDefault || activeW?.isLegacy);
|
||||||
const removeBtn = canRemove
|
const rowMenu = canRemove
|
||||||
? `<button class="wact wactdel" data-wremove="${esc(walletId)}" title="Remove this ${esc(meta.ticker)} wallet from Aegis">🗑</button>`
|
? `<button class="wact" data-wedit="${esc(walletId)}" title="Rename, derivation path, or remove this ${esc(meta.ticker)} wallet">⋯</button>`
|
||||||
: `<span class="wact" title="Default wallet — cannot be removed" style="opacity:.35;cursor:not-allowed">🔒</span>`;
|
: `<span class="wact" title="Default wallet — protects legacy funds; cannot be removed" style="opacity:.35;cursor:not-allowed">🔒</span>`;
|
||||||
|
|
||||||
rows.push(`<div class="wrow ${groupHasSel ? "on" : ""}" ${clickAction} data-groupkey="${esc(subKey)}" title="${esc(meta.coinName)} — open addresses" draggable="true" data-chain="${esc(chain)}">
|
rows.push(`<div class="wrow ${groupHasSel ? "on" : ""}" ${clickAction} data-groupkey="${esc(subKey)}" title="${esc(meta.coinName)} — open addresses" draggable="true" data-chain="${esc(chain)}">
|
||||||
<span class="wcell wclogo">${logoSvg(meta.logo, 16)}</span>
|
<span class="wcell wclogo">${logoSvg(meta.logo, 16)}</span>
|
||||||
|
|
@ -2254,8 +2234,7 @@ function renderWalletStrip() {
|
||||||
${totalFiat ? `<span class="wfiat">${esc(totalFiat)}</span>` : ""}
|
${totalFiat ? `<span class="wfiat">${esc(totalFiat)}</span>` : ""}
|
||||||
</span>
|
</span>
|
||||||
<span class="wcell wcact">
|
<span class="wcell wcact">
|
||||||
<button class="wact" ${editAttr} title="${single ? "Rename / derivation path / remove" : "Manage wallets"}">✎</button>
|
${rowMenu}
|
||||||
${removeBtn}
|
|
||||||
</span>
|
</span>
|
||||||
</div>`);
|
</div>`);
|
||||||
}
|
}
|
||||||
|
|
@ -2314,12 +2293,6 @@ function renderWalletStrip() {
|
||||||
const w = (state?.wallets || []).find((x) => x.id === b.dataset.wedit);
|
const w = (state?.wallets || []).find((x) => x.id === b.dataset.wedit);
|
||||||
if (w) openWalletManageModal(w);
|
if (w) openWalletManageModal(w);
|
||||||
}));
|
}));
|
||||||
el.querySelectorAll(".wact[data-wremove]").forEach((b) => b.addEventListener("click", async (e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
const id = b.dataset.wremove;
|
|
||||||
try { await removeWalletWithConfirm(id); }
|
|
||||||
catch (er) { showErr(cleanErr(er)); }
|
|
||||||
}));
|
|
||||||
el.querySelectorAll(".wact[data-openlist]").forEach((b) => b.addEventListener("click", (e) => {
|
el.querySelectorAll(".wact[data-openlist]").forEach((b) => b.addEventListener("click", (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
stripView = { mode: "addresses", groupKey: b.dataset.openlist };
|
stripView = { mode: "addresses", groupKey: b.dataset.openlist };
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue