]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Revert "Update only happens when phrase is changed"
authorIan Coleman <coleman.ian@gmail.com>
Thu, 25 Sep 2014 00:39:06 +0000 (10:39 +1000)
committerIan Coleman <coleman.ian@gmail.com>
Thu, 25 Sep 2014 00:39:06 +0000 (10:39 +1000)
This reverts commit 04f789cdbdb8e50511efdf97c900f7f83662eedb.

bip39-standalone.html
src/js/index.js

index 9bc6e88fbca0010202b3bebde6e7fa0aa6a9f43b..591cdce272107a0609d71dbff917b4183a2152e8 100644 (file)
@@ -22733,8 +22733,6 @@ WORDLISTS = {
     DOM.privateKeyToggle = $(".private-key-toggle");
 
     var derivationPath = DOM.bip44path.val();
-    var currentPhrase = DOM.phrase.val();
-    var currentPassphrase = DOM.passphrase.val();
 
     function init() {
         // Events
@@ -22759,9 +22757,6 @@ WORDLISTS = {
     // Event handlers
 
     function delayedPhraseChanged() {
-        if (!hasChanged()) {
-            return;
-        }
         hideValidationError();
         showPending();
         if (phraseChangeTimeoutEvent != null) {
@@ -22791,9 +22786,6 @@ WORDLISTS = {
         calcBip32Seed(phrase, passphrase, derivationPath);
         displayBip32Info();
         hidePending();
-        // Set current state so we only update as needed
-        currentPhrase = phrase;
-        currentPassphrase = passphrase;
     }
 
     function generateClicked() {
@@ -22815,9 +22807,7 @@ WORDLISTS = {
     }
 
     function derivationChanged() {
-        hideValidationError();
-        showPending();
-        setTimeout(phraseChanged, 50);
+        delayedPhraseChanged();
     }
 
     function bip32Changed() {
@@ -23046,12 +23036,6 @@ WORDLISTS = {
             .hide();
     }
 
-    function hasChanged() {
-        var phraseChanged = DOM.phrase.val() != currentPhrase;
-        var passphraseChanged = DOM.passphrase.val() != currentPassphrase;
-        return phraseChanged || passphraseChanged;
-    }
-
     init();
 
 })();
index 5bdb7ab5b7c7ea3036ac5210d851b32fb94cace6..cee8ffbac5d36a557208e6058dd5445420f20d99 100644 (file)
@@ -32,8 +32,6 @@
     DOM.privateKeyToggle = $(".private-key-toggle");
 
     var derivationPath = DOM.bip44path.val();
-    var currentPhrase = DOM.phrase.val();
-    var currentPassphrase = DOM.passphrase.val();
 
     function init() {
         // Events
@@ -58,9 +56,6 @@
     // Event handlers
 
     function delayedPhraseChanged() {
-        if (!hasChanged()) {
-            return;
-        }
         hideValidationError();
         showPending();
         if (phraseChangeTimeoutEvent != null) {
@@ -90,9 +85,6 @@
         calcBip32Seed(phrase, passphrase, derivationPath);
         displayBip32Info();
         hidePending();
-        // Set current state so we only update as needed
-        currentPhrase = phrase;
-        currentPassphrase = passphrase;
     }
 
     function generateClicked() {
     }
 
     function derivationChanged() {
-        hideValidationError();
-        showPending();
-        setTimeout(phraseChanged, 50);
+        delayedPhraseChanged();
     }
 
     function bip32Changed() {
             .hide();
     }
 
-    function hasChanged() {
-        var phraseChanged = DOM.phrase.val() != currentPhrase;
-        var passphraseChanged = DOM.passphrase.val() != currentPassphrase;
-        return phraseChanged || passphraseChanged;
-    }
-
     init();
 
 })();