aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2017-08-16 11:04:13 +1000
committerIan Coleman <coleman.ian@gmail.com>2017-08-16 11:04:13 +1000
commit0eda54f5a7a05bcc6fb94b90f288c5f93d5cfd0b (patch)
treed1e3b733e1cfe25e180eef38d75c0cedaf5c5e50
parented6d9d3905aa581f1a76d37d601c6be39954d1ff (diff)
downloadBIP39-0eda54f5a7a05bcc6fb94b90f288c5f93d5cfd0b.tar.gz
BIP39-0eda54f5a7a05bcc6fb94b90f288c5f93d5cfd0b.tar.zst
BIP39-0eda54f5a7a05bcc6fb94b90f288c5f93d5cfd0b.zip
Improve showing feedback for pending calculations
-rw-r--r--src/js/index.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/js/index.js b/src/js/index.js
index 2e14a40..678d52b 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -188,7 +188,6 @@
188 188
189 function phraseChanged() { 189 function phraseChanged() {
190 showPending(); 190 showPending();
191 hideValidationError();
192 setMnemonicLanguage(); 191 setMnemonicLanguage();
193 // Get the mnemonic phrase 192 // Get the mnemonic phrase
194 var phrase = DOM.phrase.val(); 193 var phrase = DOM.phrase.val();
@@ -201,7 +200,6 @@
201 var passphrase = DOM.passphrase.val(); 200 var passphrase = DOM.passphrase.val();
202 calcBip32RootKeyFromSeed(phrase, passphrase); 201 calcBip32RootKeyFromSeed(phrase, passphrase);
203 calcForDerivationPath(); 202 calcForDerivationPath();
204 hidePending();
205 } 203 }
206 204
207 function delayedEntropyChanged() { 205 function delayedEntropyChanged() {
@@ -277,10 +275,9 @@
277 } 275 }
278 276
279 function calcForDerivationPath() { 277 function calcForDerivationPath() {
280 showPending();
281 clearDerivedKeys(); 278 clearDerivedKeys();
282 clearAddressesList(); 279 clearAddressesList();
283 hideValidationError(); 280 showPending();
284 // Don't show bip49 if it's selected but network doesn't support it 281 // Don't show bip49 if it's selected but network doesn't support it
285 if (bip49TabSelected() && !networkHasBip49()) { 282 if (bip49TabSelected() && !networkHasBip49()) {
286 return; 283 return;
@@ -300,7 +297,6 @@
300 displayBip49Info(); 297 displayBip49Info();
301 } 298 }
302 displayBip32Info(); 299 displayBip32Info();
303 hidePending();
304 } 300 }
305 301
306 function generateClicked() { 302 function generateClicked() {
@@ -607,17 +603,19 @@
607 for (var i=0; i<rows.length; i++) { 603 for (var i=0; i<rows.length; i++) {
608 rows[i].shouldGenerate = false; 604 rows[i].shouldGenerate = false;
609 } 605 }
606 hidePending();
610 } 607 }
611 608
612 for (var i=0; i<total; i++) { 609 for (var i=0; i<total; i++) {
613 var index = i + start; 610 var index = i + start;
614 rows.push(new TableRow(index)); 611 var isLast = i == total - 1;
612 rows.push(new TableRow(index, isLast));
615 } 613 }
616 614
617 })()); 615 })());
618 } 616 }
619 617
620 function TableRow(index) { 618 function TableRow(index, isLast) {
621 619
622 var self = this; 620 var self = this;
623 this.shouldGenerate = true; 621 this.shouldGenerate = true;
@@ -679,6 +677,9 @@
679 address = bitcoinjs.bitcoin.address.fromOutputScript(scriptpubkey, network) 677 address = bitcoinjs.bitcoin.address.fromOutputScript(scriptpubkey, network)
680 } 678 }
681 addAddressToList(indexText, address, pubkey, privkey); 679 addAddressToList(indexText, address, pubkey, privkey);
680 if (isLast) {
681 hidePending();
682 }
682 }, 50) 683 }, 50)
683 } 684 }
684 685