Commit 3de3a797 authored by kenshin-samourai's avatar kenshin-samourai
Browse files

add an alert on detection of leading/trailing spaces in the passphrase

parent cf699ebb
......@@ -69,6 +69,12 @@ div.result {
word-break: break-all;
}
.alert {
color: red;
font-weight: bold;
display: none;
}
.left {
text-align: left!important;
}
......
......@@ -47,6 +47,7 @@
<th>BIP39 PASSPHRASE</th>
<td>
<textarea id="alice_passphrase"></textarea>
<span id="alice_passphrase_alert" class="alert">Leading/trailing spaces detected in the passphrase</span>
</td>
<td>-</td>
</tr>
......
......@@ -48,6 +48,7 @@ function checkPaymentCode() {
alert('This is not a valid payment code')
}
function refresh() {
const a_p2pkh_addr = []
const a_p2wpkh_addr = []
......@@ -89,6 +90,12 @@ function refresh() {
const hasValidMnemonic = isValidMnemonic(a_mnemonic)
const hasValidPaymentCode = isValidPaymentCode(b_pcode_b58, network)
const trimmed_a_passphrase = a_passphrase.trim()
if (trimmed_a_passphrase != a_passphrase)
$('#alice_passphrase_alert').css('display', 'block')
else
$('#alice_passphrase_alert').css('display', 'none')
//
// Compute bip47 derivations
//
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment