From 126af2bee3970d2e2573dc74e1ca71471b4e3c83 Mon Sep 17 00:00:00 2001 From: Macha-orange <69054565+Macha-orange@users.noreply.github.com> Date: Sat, 17 Jul 2021 12:38:47 +0200 Subject: [PATCH 1/2] Add "auto compute" check box When checked, nothing change. When unchecked, disable phraseChangeTimeoutEvent() so there is no update. Also, add an error message "Auto compute is disabled" so after changing phrase/passephrase and parameters, you are reminded to check "auto compute" to compute your seed. I added this because on very low end computer (raspberry pi) the computing is quite annoying and you have to wait for each change. When you add a custom words, seed is computed every 400ms so you have to copy/paste it to not be stuck after each letter. And if you encrypt your private key with BIP38 it become unusable. Autocompute is by default checked so there is no change for other users. --- src/index.html | 9 +++++++++ src/js/index.js | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/index.html b/src/index.html index 854043b..6a24a1f 100644 --- a/src/index.html +++ b/src/index.html @@ -181,6 +181,15 @@ +
+
+
+ +
+
diff --git a/src/js/index.js b/src/js/index.js index e46c3d5..50b781b 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -47,6 +47,7 @@ DOM.entropyWeakEntropyOverrideWarning = DOM.entropyContainer.find(".weak-entropy-override-warning"); DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning"); DOM.phrase = $(".phrase"); + DOM.autoCompute = $(".autoCompute"); DOM.splitMnemonic = $(".splitMnemonic"); DOM.showSplitMnemonic = $(".showSplitMnemonic"); DOM.phraseSplit = $(".phraseSplit"); @@ -143,6 +144,7 @@ DOM.network.on("change", networkChanged); DOM.bip32Client.on("change", bip32ClientChanged); DOM.useEntropy.on("change", setEntropyVisibility); + DOM.autoCompute.on("change", delayedPhraseChanged); DOM.entropy.on("input", delayedEntropyChanged); DOM.entropyMnemonicLength.on("change", entropyChanged); DOM.entropyTypeInputs.on("change", entropyTypeChanged); @@ -234,6 +236,10 @@ } } + function isUsingAutoCompute() { + return DOM.autoCompute.prop("checked"); + } + function setEntropyVisibility() { if (isUsingOwnEntropy()) { DOM.entropyContainer.removeClass("hidden"); @@ -251,6 +257,8 @@ } function delayedPhraseChanged() { + + if(isUsingAutoCompute()) { hideValidationError(); seed = null; bip32RootKey = null; @@ -270,6 +278,11 @@ entropyTypeAutoDetect = false; } }, 400); + } else { + clearDisplay(); + clearEntropyFeedback(); + showValidationError("Auto compute disabled"); + } } function phraseChanged() { From 530a9f60474a5b1818e91afb6ce1805bf1b3070c Mon Sep 17 00:00:00 2001 From: Macha-orange <69054565+Macha-orange@users.noreply.github.com> Date: Sat, 17 Jul 2021 12:47:37 +0200 Subject: [PATCH 2/2] Typo --- src/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/index.js b/src/js/index.js index 50b781b..2740a59 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -281,7 +281,7 @@ } else { clearDisplay(); clearEntropyFeedback(); - showValidationError("Auto compute disabled"); + showValidationError("Auto compute is disabled"); } }