diff options
| -rw-r--r-- | src/features/names.js | 22 | ||||
| -rw-r--r-- | src/i18n.js | 1 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/features/names.js b/src/features/names.js index 69987e3..73e34de 100644 --- a/src/features/names.js +++ b/src/features/names.js @@ -593,10 +593,24 @@ export function namesFeature(ctx) { // instead of leaving a picked name looking ignored. sendFormNote(a) { const nr = ui.nameResolve; - if (!nr || nr.text !== a) return null; - return h('div', { class: 'row gap6', style: 'align-items:center;justify-content:center' }, - h('span', { class: 'spinner sm' }), - h('span', { class: 'small muted' }, t('namesResolving', { name: String(a || '').trim() }))); + if (nr && nr.text === a) { + return h('div', { class: 'row gap6', style: 'align-items:center;justify-content:center' }, + h('span', { class: 'spinner sm' }), + h('span', { class: 'small muted' }, t('namesResolving', { name: String(a || '').trim() }))); + } + // A TYPED name on one of our domains: offer the native send (BIP-353 → + // instant ark) as a button, mirroring the zap affordance — typed input + // never auto-advances, since a half-typed domain parses as a name too. + // This note outranks the zaps one (feature order), so our names get the + // free instant rail instead of an LNURL round-trip. + const parsed = parsePaymentName(a); + if (parsed && OUR_DOMAINS.includes(parsed.domain) && hook('arkReady')) { + return h('button', { + type: 'button', class: 'btn-primary btn-block', + onClick: () => beginResolve(a), + }, t('namesSendTo', { name: `${parsed.name}@${parsed.domain}` })); + } + return null; }, settingsCards() { return [namesCard()]; }, }; diff --git a/src/i18n.js b/src/i18n.js index 95d54fb..570cdfc 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -656,6 +656,7 @@ const STR = { namesDesc: 'Claim your payment address — like [email protected]. People can pay you just by typing it, no codes to copy or QR to scan.', namesPlaceholder: 'username', namesResolving: 'Looking up {name}…', + namesSendTo: 'Send to {name}', namesClaim: 'Claim', namesClaimed: 'You are now {name}', namesCopy: 'Copy address', |
