From 473bc6f76a7c57d918ddba7fbff099bfc3687aa6 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 3 Nov 2024 01:10:24 -0700 Subject: [PATCH] Fix dynamic visibility page content when selecting wallets and mnemonic/seed value when selecting import type. Remove hr styling added for testing. Reset QR code when reloading to no account. Add id for label elements in forms. --- nemo-wallet.html | 52 +++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/nemo-wallet.html b/nemo-wallet.html index 961003e..464c944 100644 --- a/nemo-wallet.html +++ b/nemo-wallet.html @@ -213,6 +213,9 @@ } default: { try { + document.getElementById('wallet-new').classList.add('hide') + document.getElementById('wallet-import').classList.add('hide') + document.querySelector(location.hash).classList.remove('hide') await reloadAccountSelect() document.getElementById('account').value = '' } catch (err) { @@ -293,17 +296,21 @@ const algorithm = document.getElementById(`${id}-algorithm-select`) const typeContainer = document.getElementById(`${id}-type`) const type = document.getElementById(`${id}-type-select`) + const importValueContainer = document.getElementById(`${id}-value`) + const importValue = document.getElementById(`${id}-value-input`) + const importValueLabel = document.getElementById(`${id}-value-label`) const saltContainer = document.getElementById(`${id}-salt`) const salt = document.getElementById(`${id}-salt-input`) - if (algorithm.value === 'bip44' && type?.value !== 'seed') { + if (algorithm.value === 'bip44' && type?.value === 'mnemonic') { saltContainer.classList.remove('hide') } else { saltContainer.classList.add('hide') } - const importValue = document.getElementById(`${id}-value-input`) - const importValueLabel = document.querySelector(`${id}-value label`) + if (type?.value != null && type?.value !== '') { + importValueContainer.classList.remove('hide') + } if (importValueLabel) { - importValueLabel.innerText = type.value + importValueLabel.textContent = type.value } } @@ -377,6 +384,7 @@ const accountOptions = accounts.map(a => { return { text: a.name, value: a.index } }) + resetQrCode() await resetSelectOptions('account', accountOptions) } @@ -500,6 +508,7 @@ const account = document.getElementById('account') if (wallet.value === '' || account.value.substring(0, 1) === '_') { account.value = '' + resetQrCode() } } @@ -637,10 +646,6 @@ h1 { text-align: center; } - hr { - border: 10px solid var(--theme-content) !important; - height: 10px !important; - } label { margin-right: 0.5em; } @@ -836,12 +841,12 @@

New Wallet

- +
- +
- +
- +
@@ -874,12 +879,12 @@

Import Wallet

- +
- +
-
- +
+
- + + placeholder="" required />
- +
- +
@@ -926,17 +932,17 @@

New Account

- +
- +
- +
-- 2.34.1