fix: the delete wallet screens name the wallet's own key material (closes #529)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s

DeleteWallet and DeleteWalletLostPassword told key and xprv wallets that
their recovery phrase was the way back, but those wallets have none. Both
screens now name the recovery phrase, the private key or the extended
private key, according to the wallet's kind.

The noun comes from keyMaterialName() in the popup view helpers, which
DeleteAddress now uses too in place of its own two-way choice, so there is
one place that picks it. The lost-password screen's route-back sentence is
reworded to fit all three kinds.

Model: opus-5-5
This commit is contained in:
2026-10-19 03:36:34 +00:00
parent cb58e9d5f7
commit 50454216da
6 changed files with 69 additions and 17 deletions
+12
View File
@@ -25,6 +25,7 @@ const { isDebug } = require("../../shared/log");
const { formatUsd, getPrice } = require("../../shared/prices");
const { state, saveState, currentNetwork } = require("../../shared/state");
const { displaySymbol } = require("../../shared/symbolDisplay");
const { walletHasRecoveryPhrase } = require("../../shared/wallet");
const { markViewRendered } = require("../viewRouter");
// When views are added, removed, or transitions between them change,
@@ -418,6 +419,16 @@ function addressHoldsFunds(addr) {
return false;
}
// What a wallet was imported from, which is also its only backup: the
// recovery phrase, the private key or the extended private key. The screens
// that tell the user what to keep or import again name it through here, so
// a key or xprv wallet is never sent looking for a recovery phrase.
function keyMaterialName(wallet) {
if (walletHasRecoveryPhrase(wallet)) return "recovery phrase";
if (wallet.type === "key") return "private key";
return "extended private key";
}
// The fewest characters of an address any caller may ask to display. The
// 10-character cap inside truncateMiddle() is the other half of the same
// guarantee; this is the half that used to be spelled out at each call
@@ -725,6 +736,7 @@ module.exports = {
balanceLine,
balanceLinesForAddress,
addressHoldsFunds,
keyMaterialName,
unknownableAmount,
nativeCurrency,
tokenLabel,