aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app.js17
-rw-r--r--src/i18n.js2
2 files changed, 18 insertions, 1 deletions
diff --git a/src/app.js b/src/app.js
index 1f45a0a..f812184 100644
--- a/src/app.js
+++ b/src/app.js
@@ -1151,6 +1151,7 @@ function lock() {
ui.vaultPw = '';
ui.vaultError = '';
ui.confirmClear = false;
+ ui.confirmRemove = null;
ui.editId = null;
ui.editLabel = '';
ui.createStep = 'gen';
@@ -1932,6 +1933,20 @@ function accountsScreen() {
)
);
}
+ if (ui.confirmRemove) {
+ const acc = accounts.find((a) => a.id === ui.confirmRemove);
+ return h('div', { class: 'col', style: 'gap:16px' },
+ brandHeader(false),
+ h('div', { class: 'card col' },
+ h('h3', {}, t('removeWalletTitle')),
+ h('div', { class: 'warn-box' }, t('removeWalletWarn', { name: acc ? acc.label : '' })),
+ h('div', { class: 'row gap6' },
+ h('button', { class: 'btn-ghost grow', onClick: () => { ui.confirmRemove = null; render(); } }, t('back')),
+ h('button', { class: 'btn-primary grow', onClick: () => { const id = ui.confirmRemove; ui.confirmRemove = null; removeAccount(id); } }, t('remove'))
+ )
+ )
+ );
+ }
return h(
'div',
{ class: 'col', style: 'gap:16px' },
@@ -1958,7 +1973,7 @@ function accountsScreen() {
onClick: () => { if (isActive) { ui.screen = 'wallet'; render(); } else switchAccount(a.id); },
}, (isActive ? '● ' : '○ ') + a.label + tag),
h('button', { class: 'btn-sm', title: t('rename'), onClick: () => { ui.editId = a.id; ui.editLabel = a.label; render(); } }, '✎'),
- h('button', { class: 'btn-sm', title: t('remove'), onClick: () => removeAccount(a.id) }, '✕')
+ h('button', { class: 'btn-sm', title: t('remove'), onClick: () => { ui.confirmRemove = a.id; render(); } }, '✕')
),
a.type === 'full'
? h('button', { class: 'linklike small', style: 'align-self:flex-start', onClick: () => (a.persisted ? startForget(a.id) : startSave(a.id)) },
diff --git a/src/i18n.js b/src/i18n.js
index b96f536..2752ea8 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -40,6 +40,8 @@ const STR = {
addWallet: 'Add wallet',
clearAll: 'Clear all',
clearAllWarn: '⚠ This removes every wallet from this device. Any wallet whose recovery phrase or key you have not backed up will be lost for good.',
+ removeWalletTitle: 'Remove wallet',
+ removeWalletWarn: '⚠ Remove “{name}” from this device? It will be gone from this browser — make sure you have its recovery phrase. Other wallets aren’t affected.',
rename: 'Rename',
remove: 'Remove',
watchOnly: 'Watch-only',