mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-05 18:43:47 +00:00
Update only happens when phrase is changed
ie not on keyup where the key is ctrl or arrow-key etc.
This commit is contained in:
@@ -22733,6 +22733,8 @@ WORDLISTS = {
|
||||
DOM.privateKeyToggle = $(".private-key-toggle");
|
||||
|
||||
var derivationPath = DOM.bip44path.val();
|
||||
var currentPhrase = DOM.phrase.val();
|
||||
var currentPassphrase = DOM.passphrase.val();
|
||||
|
||||
function init() {
|
||||
// Events
|
||||
@@ -22757,6 +22759,9 @@ WORDLISTS = {
|
||||
// Event handlers
|
||||
|
||||
function delayedPhraseChanged() {
|
||||
if (!hasChanged()) {
|
||||
return;
|
||||
}
|
||||
hideValidationError();
|
||||
showPending();
|
||||
if (phraseChangeTimeoutEvent != null) {
|
||||
@@ -22786,6 +22791,9 @@ WORDLISTS = {
|
||||
calcBip32Seed(phrase, passphrase, derivationPath);
|
||||
displayBip32Info();
|
||||
hidePending();
|
||||
// Set current state so we only update as needed
|
||||
currentPhrase = phrase;
|
||||
currentPassphrase = passphrase;
|
||||
}
|
||||
|
||||
function generateClicked() {
|
||||
@@ -22807,7 +22815,9 @@ WORDLISTS = {
|
||||
}
|
||||
|
||||
function derivationChanged() {
|
||||
delayedPhraseChanged();
|
||||
hideValidationError();
|
||||
showPending();
|
||||
setTimeout(phraseChanged, 50);
|
||||
}
|
||||
|
||||
function bip32Changed() {
|
||||
@@ -23036,6 +23046,12 @@ WORDLISTS = {
|
||||
.hide();
|
||||
}
|
||||
|
||||
function hasChanged() {
|
||||
var phraseChanged = DOM.phrase.val() != currentPhrase;
|
||||
var passphraseChanged = DOM.passphrase.val() != currentPassphrase;
|
||||
return phraseChanged || passphraseChanged;
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
})();
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
DOM.privateKeyToggle = $(".private-key-toggle");
|
||||
|
||||
var derivationPath = DOM.bip44path.val();
|
||||
var currentPhrase = DOM.phrase.val();
|
||||
var currentPassphrase = DOM.passphrase.val();
|
||||
|
||||
function init() {
|
||||
// Events
|
||||
@@ -56,6 +58,9 @@
|
||||
// Event handlers
|
||||
|
||||
function delayedPhraseChanged() {
|
||||
if (!hasChanged()) {
|
||||
return;
|
||||
}
|
||||
hideValidationError();
|
||||
showPending();
|
||||
if (phraseChangeTimeoutEvent != null) {
|
||||
@@ -85,6 +90,9 @@
|
||||
calcBip32Seed(phrase, passphrase, derivationPath);
|
||||
displayBip32Info();
|
||||
hidePending();
|
||||
// Set current state so we only update as needed
|
||||
currentPhrase = phrase;
|
||||
currentPassphrase = passphrase;
|
||||
}
|
||||
|
||||
function generateClicked() {
|
||||
@@ -106,7 +114,9 @@
|
||||
}
|
||||
|
||||
function derivationChanged() {
|
||||
delayedPhraseChanged();
|
||||
hideValidationError();
|
||||
showPending();
|
||||
setTimeout(phraseChanged, 50);
|
||||
}
|
||||
|
||||
function bip32Changed() {
|
||||
@@ -335,6 +345,12 @@
|
||||
.hide();
|
||||
}
|
||||
|
||||
function hasChanged() {
|
||||
var phraseChanged = DOM.phrase.val() != currentPhrase;
|
||||
var passphraseChanged = DOM.passphrase.val() != currentPassphrase;
|
||||
return phraseChanged || passphraseChanged;
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user