Fix generate button being disabled when not using custom entropy

This commit is contained in:
moneromooo-monero 2017-10-07 12:26:47 +01:00
parent da2e7d937f
commit c6e3ffb30b
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
2 changed files with 14 additions and 17 deletions

View file

@ -10741,7 +10741,7 @@ bC0zLjUsMjAuNGgtNkwyNDQuOCwzMTAuNkwyNDQuOCwzMTAuNnoiLz4KPC9nPgo8L3N2Zz4K">
<div class="row valign-wrapper">
<div class="col s4 right-align ">
<input class="btn orange" type="button" onclick="js:genwallet(null);"
value="Generate wallet" id="gen_with_custom_entropy_button" disabled="disabled" action=""/>
value="Generate wallet" id="gen_with_custom_entropy_button" action=""/>
<p>Custom entropy for deterministic wallet (leave empty to use the browser's PRNG)</p>
<input type="text" value="" id="user_entropy_widget" oninput="js:checkEntropy();" />
<div style="color: red; display: none" id="user_entropy_warning_widget">WARNING: entropy is way too low for the wallet to be secure: aim for 256 bits (about a hundred dice throws)</div>
@ -11121,13 +11121,10 @@ function checkEntropy()
var user_entropy = user_entropy_widget.value;
var user_entropy_warning_widget = document.getElementById("user_entropy_warning_widget")
if (user_entropy.length === 0) {
good = false;
button.disabled = true
user_entropy_warning_widget.style.display = "none"
return
}
button.disabled = false
var count = new Int32Array(256);
for (var n = 0; n < 256; ++n)
count[n] = 0