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