fix: say a second wallet's password is separate when one is chosen (closes #374)
The add-wallet screen offered only "Choose a password" while each wallet keeps its own encrypted secret, so a second wallet silently accepted a password different from the first with nothing marking it as separate. A note now appears on that screen when the profile already holds a wallet, saying each wallet has its own password and this one need not match any already in use. It is shown only then — the first wallet has no other password to differ from — and is decided on screen entry, so it does not move the password fields. It promises no recovery or reset, staying consistent with the no-password-reset design. Model: opus-4-8
This commit was merged in pull request #390.
This commit is contained in:
@@ -100,9 +100,24 @@ function clear() {
|
||||
$("add-wallet-phrase-warning").style.visibility = "hidden";
|
||||
}
|
||||
|
||||
// Each wallet has its own password (its own encryptedSecret), so adding a
|
||||
// second wallet does not reuse the first one's. The note that says so is
|
||||
// only meaningful once a wallet exists — on the first wallet there is no
|
||||
// other password to be separate from — so it is shown only then. This is
|
||||
// decided on entry and stays put while the screen is up, so it does not
|
||||
// move the password fields the way a per-tab hint would.
|
||||
function updateSeparatePasswordNote() {
|
||||
const hasExistingWallet = state.wallets.length > 0;
|
||||
$("add-wallet-separate-password-note").classList.toggle(
|
||||
"hidden",
|
||||
!hasExistingWallet,
|
||||
);
|
||||
}
|
||||
|
||||
function show() {
|
||||
clear();
|
||||
switchMode("mnemonic");
|
||||
updateSeparatePasswordNote();
|
||||
showView("add-wallet");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user