diff options
| author | Adam Soltys <[email protected]> | 2026-08-15 19:52:03 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-15 19:52:03 -0700 |
| commit | ecc3fb207395122d4a4f43887ef08f28cc6d9879 (patch) | |
| tree | 192714e65e2b2757ac578d09e32fa93637329c3f /src/features/names.js | |
| parent | c6cc2d3b429a58c87fa3f4ebf259564bbc210d82 (diff) | |
| download | coinosv3-ecc3fb207395122d4a4f43887ef08f28cc6d9879.tar.gz coinosv3-ecc3fb207395122d4a4f43887ef08f28cc6d9879.zip | |
Username and display name go their separate ways: the handle wears a frozen @coinos.io so it reads as address and NIP-05, renames claim before the profile publishes, and nip05 rides along with lud16
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014tE4U5nEjGTQy8PwYqamfv
Diffstat (limited to 'src/features/names.js')
| -rw-r--r-- | src/features/names.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/features/names.js b/src/features/names.js index b021956..aa60aa4 100644 --- a/src/features/names.js +++ b/src/features/names.js @@ -62,7 +62,7 @@ export function namesFeature(ctx) { return addr ? `bitcoin:?ark=${encodeURIComponent(addr)}` : null; } - async function claim(name, { signer, manager } = {}) { + async function claim(name, { signer, manager, quietProfile } = {}) { const uri = await currentUri(); if (!uri) throw new Error(t('namesNeedArk')); const j = await post('/register', 'POST', { @@ -79,9 +79,12 @@ export function namesFeature(ctx) { if (prev && prev !== name) { post('/register', 'DELETE', { name: prev, domain: DOMAIN }).catch(() => {}); // the old address just died — a kind 0 still pointing at it would send - // zaps into the void, so the profile's lud16 follows the rename - // (messages only touches it if it pointed at the released name) - Promise.resolve(hook('addressRenamed', `${prev}@${DOMAIN}`, `${name}@${DOMAIN}`)).catch(() => {}); + // zaps into the void, so the profile's lud16/nip05 follow the rename + // (messages only touches them if they pointed at the released name). + // quietProfile: the profile editor claims mid-save and folds these + // fields into its own publish — a second publish here would race it. + if (!quietProfile) + Promise.resolve(hook('addressRenamed', `${prev}@${DOMAIN}`, `${name}@${DOMAIN}`)).catch(() => {}); } return j; } @@ -544,7 +547,7 @@ export function namesFeature(ctx) { // the onboarding wizard renders the same claim form on its username step namesClaimForm() { return claimForm(true); }, // claim a specific name (the migration flow, after coinos.io released it) - namesClaimName(name) { return claim(String(name).toLowerCase()); }, + namesClaimName(name, opts) { return claim(String(name).toLowerCase(), opts || {}); }, stop() { clearTimeout(retryTimer); clearTimeout(deadline); deadline = null; }, receiveModes() { if (!available()) return []; |
