fix: the delete wallet screens name the wallet's own key material (closes #529)
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 these three screens get it from one place. The lost-password screen's route-back sentence is reworded to fit all three kinds. Model: opus-5-5
This commit was merged in pull request #590.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
// The name of a wallet's key material, which is also its only backup: the
|
||||
// recovery phrase of an HD wallet, the private key of a key wallet, the
|
||||
// extended private key of an xprv wallet. DeleteWallet,
|
||||
// DeleteWalletLostPassword and DeleteAddress name the backup with it.
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user