mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-28 21:30:41 +00:00
Addresses shown in table as they're calculated
Less waiting, and doesn't block the UI.
This commit is contained in:
+17
-5
@@ -239,12 +239,28 @@
|
|||||||
|
|
||||||
function displayAddresses(start, total) {
|
function displayAddresses(start, total) {
|
||||||
for (var i=0; i<total; i++) {
|
for (var i=0; i<total; i++) {
|
||||||
var index = i+ start;
|
var index = i + start;
|
||||||
|
new TableRow(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function TableRow(index) {
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
calculateValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
function calculateValues() {
|
||||||
|
setTimeout(function() {
|
||||||
var key = bip32ExtendedKey.derive(index);
|
var key = bip32ExtendedKey.derive(index);
|
||||||
var address = key.getAddress().toString();
|
var address = key.getAddress().toString();
|
||||||
var privkey = key.privKey.toWIF(network);
|
var privkey = key.privKey.toWIF(network);
|
||||||
addAddressToList(index, address, privkey);
|
addAddressToList(index, address, privkey);
|
||||||
|
}, 50)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMore() {
|
function showMore() {
|
||||||
@@ -261,11 +277,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showPending();
|
|
||||||
setTimeout(function() {
|
|
||||||
displayAddresses(start, rowsToAdd);
|
displayAddresses(start, rowsToAdd);
|
||||||
hidePending();
|
|
||||||
}, 50);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearDisplay() {
|
function clearDisplay() {
|
||||||
|
|||||||
Reference in New Issue
Block a user