From 59780293832d7a27d34378d4e47e7995f7d154a0 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Thu, 25 Sep 2014 10:39:06 +1000 Subject: [PATCH] Revert "Update only happens when phrase is changed" This reverts commit 04f789cdbdb8e50511efdf97c900f7f83662eedb. --- bip39-standalone.html | 18 +----------------- src/js/index.js | 18 +----------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/bip39-standalone.html b/bip39-standalone.html index 9bc6e88..591cdce 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html @@ -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(); })(); diff --git a/src/js/index.js b/src/js/index.js index 5bdb7ab..cee8ffb 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -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() { @@ -114,9 +106,7 @@ } function derivationChanged() { - hideValidationError(); - showPending(); - setTimeout(phraseChanged, 50); + delayedPhraseChanged(); } function bip32Changed() { @@ -345,12 +335,6 @@ .hide(); } - function hasChanged() { - var phraseChanged = DOM.phrase.val() != currentPhrase; - var passphraseChanged = DOM.passphrase.val() != currentPassphrase; - return phraseChanged || passphraseChanged; - } - init(); })(); -- 2.41.0