aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/app.js b/src/app.js
index d4d13b8..63b638b 100644
--- a/src/app.js
+++ b/src/app.js
@@ -770,12 +770,28 @@ function createPane() {
'div',
{ class: 'col' },
h('p', { class: 'muted' }, t('genIntro')),
+ // BYO randomness for the seed — folded away so the common path stays
+ // one button. Whatever is typed here is hashed together with the
+ // device's own randomness (see newMnemonic), never used alone.
+ h('button', {
+ class: 'linklike small', style: 'align-self:flex-start',
+ onClick: () => { ui.ownEntropyOpen = !ui.ownEntropyOpen; render(); },
+ }, (ui.ownEntropyOpen ? '▾ ' : '▸ ') + t('entropyToggle')),
+ ui.ownEntropyOpen
+ ? h('div', { class: 'col gap6' },
+ h('p', { class: 'small muted', style: 'margin:0' }, t('entropyHint')),
+ h('textarea', {
+ rows: '2', style: 'font-family:var(--sans)', placeholder: t('entropyPlaceholder'),
+ autocapitalize: 'none', autocomplete: 'off', spellcheck: 'false',
+ value: ui.ownEntropy || '', onInput: (e) => (ui.ownEntropy = e.target.value),
+ }))
+ : null,
h(
'button',
{
class: 'btn-primary btn-block',
onClick: () => {
- ui.draftMnemonic = newMnemonic();
+ ui.draftMnemonic = newMnemonic(128, (ui.ownEntropy || '').trim());
render();
},
},
@@ -804,7 +820,7 @@ function createPane() {
{
class: 'btn-ghost btn-sm',
onClick: () => {
- ui.draftMnemonic = newMnemonic();
+ ui.draftMnemonic = newMnemonic(128, (ui.ownEntropy || '').trim());
render();
},
},