mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-29 05:30:54 +00:00
Tidy up split phrase warning
Make red only when danger is present Align neatly with the rest of the UI Increase size of text area to show all three rows, although it still overflows on 24 words.
This commit is contained in:
@@ -1470,16 +1470,25 @@
|
||||
DOM.splitPhrase.val(cards.join("\r\n"));
|
||||
var triesPerSecond=10000000000;
|
||||
var hackTime=Math.pow(2,wordCount*10/3)/triesPerSecond;
|
||||
var displayRedText = false;
|
||||
if (hackTime<1) {
|
||||
hackTime="<1 second";
|
||||
displayRedText = true;
|
||||
} else if (hackTime<86400) {
|
||||
hackTime=Math.floor(hackTime)+" seconds";
|
||||
displayRedText = true;
|
||||
} else if(hackTime<31557600) {
|
||||
hackTime=Math.floor(hackTime/86400)+" days";
|
||||
displayRedText = true;
|
||||
} else {
|
||||
hackTime=Math.floor(hackTime/31557600)+" years";
|
||||
}
|
||||
DOM.phraseSplitWarn.html("Time to hack with only one card: "+hackTime);
|
||||
if (displayRedText) {
|
||||
DOM.phraseSplitWarn.addClass("text-danger");
|
||||
} else {
|
||||
DOM.phraseSplitWarn.removeClass("text-danger");
|
||||
}
|
||||
}
|
||||
|
||||
function isUsingOwnEntropy() {
|
||||
|
||||
Reference in New Issue
Block a user