diff options
| author | Adam Soltys <[email protected]> | 2026-09-14 22:09:05 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-14 22:09:05 -0700 |
| commit | b14725268da32010ed5b75735f268e014adb1cf5 (patch) | |
| tree | fc35f5c70ed44456a00fde85da0ad74052541e10 /src/app.js | |
| parent | a493b12aca18a670296f0f7142ad041b87ec1b69 (diff) | |
| download | coinosv3-b14725268da32010ed5b75735f268e014adb1cf5.tar.gz coinosv3-b14725268da32010ed5b75735f268e014adb1cf5.zip | |
A seed phrase or entropy typed on the start screens is never remembered.
Switching between Create and Import, backing out of the entropy page,
signing into another account or going home all drop whatever was typed;
the entropy page always opens empty instead of refilling from an
earlier visit. Secret material is not a draft.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Diffstat (limited to 'src/app.js')
| -rw-r--r-- | src/app.js | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -930,8 +930,8 @@ function unlockCard() { h( 'div', { class: 'tabs' }, - tabBtn(t('createNew'), ui.unlockTab === 'create', () => { ui.unlockTab = 'create'; ui.unlockError = ''; render(); }), - tabBtn(t('importExisting'), ui.unlockTab === 'import', () => { ui.unlockTab = 'import'; ui.unlockError = ''; render(); }) + tabBtn(t('createNew'), ui.unlockTab === 'create', () => { clearSeedDrafts(); ui.unlockTab = 'create'; ui.unlockError = ''; render(); }), + tabBtn(t('importExisting'), ui.unlockTab === 'import', () => { clearSeedDrafts(); ui.unlockTab = 'import'; ui.unlockError = ''; render(); }) ), ui.unlockTab === 'create' ? createPane() : importPane(), ui.unlockError && h('div', { class: 'notice err' }, ui.unlockError) @@ -1097,7 +1097,7 @@ function createPane() { 'button', { class: 'btn-ghost btn-sm', - onClick: () => { ui.entropyPage = 'create'; ui.entropyEntry = ui.ownEntropy || ''; render(); }, + onClick: () => { ui.entropyPage = 'create'; ui.entropyEntry = ''; render(); }, }, t('entropyToggle') ) @@ -1193,7 +1193,7 @@ function entropyPage() { h( 'div', { class: 'row gap6' }, - h('button', { class: 'btn-ghost grow', onClick: () => { ui.entropyPage = null; render(); } }, t('back')), + h('button', { class: 'btn-ghost grow', onClick: () => { ui.entropyPage = null; ui.entropyEntry = ''; render(); } }, t('back')), h('button', { class: 'btn-primary grow', onClick: () => { const txt = (ui.entropyEntry || '').trim(); if (forCreate) { @@ -1207,12 +1207,22 @@ function entropyPage() { else if (ui.importText === ui._entropyFilled) ui.importText = ''; } ui.entropyPage = null; + ui.entropyEntry = ''; render(); } }, t('entropySubmit')) ) ); } +// A seed phrase or entropy typed into the start screens is secret material, +// not a draft: nothing typed there survives leaving the field — switching +// tabs, backing out of the entropy page, going home. Whatever you come back +// to is empty. (An opened wallet clears these too, in openWallet/lock.) +function clearSeedDrafts() { + ui.importText = ''; ui._entropyFilled = null; + ui.entropyEntry = ''; ui.ownEntropy = ''; ui.importEntropy = ''; +} + function importPane() { const ta = h('textarea', { placeholder: t('importPlaceholder'), @@ -1237,7 +1247,7 @@ function importPane() { 'button', { class: 'btn-ghost btn-sm', style: 'align-self:flex-start', - onClick: () => { ui.entropyPage = 'import'; ui.entropyEntry = ui.importEntropy || ''; render(); }, + onClick: () => { ui.entropyPage = 'import'; ui.entropyEntry = ''; render(); }, }, t('entropyToggle') ), @@ -1471,6 +1481,7 @@ async function activateAccount(acc, opts = {}) { // accounts instead of replacing them, and Back returns to the wallet. Shared // by the Accounts screen and the profile page. function signInAnother() { + clearSeedDrafts(); ui.fromWallet = true; ui.unlockError = ''; ui.unlockTab = 'import'; ui.screen = 'unlock'; ui.profilePk = null; ui.profEdit = null; ui.profEditFilled = false; ui.chatOpen = false; render(); @@ -2708,7 +2719,7 @@ function goHome() { ui.unlockTab = 'create'; ui.createStep = 'gen'; ui.draftMnemonic = ''; - ui.importText = ''; + clearSeedDrafts(); ui.entropyPage = null; ui.confirm = []; ui.unlockError = ''; |
