From a7c45156fb49e26f06a359d79240d328d88a00d5 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 3 Aug 2026 19:21:39 -0700 Subject: Profile: no editable lightning address Editing it here reads like renaming your coinos account, and for someone using an address from elsewhere it invites breaking their own zaps. The field is gone; an existing address is preserved untouched, and one is filled in from the coinos payment address only when the profile has none, so other clients can still zap them. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi --- src/features/messages.js | 11 ++++++++--- src/i18n.js | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/features/messages.js b/src/features/messages.js index 27beff9..d93a863 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -887,10 +887,17 @@ export function messagesFeature(ctx) { let base = {}; try { base = newest ? JSON.parse(newest.content) : {}; } catch {} const merged = { ...base }; - for (const [k, v] of [['name', e.name], ['about', e.about], ['picture', e.picture], ['lud16', e.lud16]]) { + for (const [k, v] of [['name', e.name], ['about', e.about], ['picture', e.picture]]) { if (v.trim()) merged[k] = v.trim(); else delete merged[k]; } + // Not an editable field: someone else's lightning address is theirs to + // manage, and editing it here reads like renaming their coinos account. + // We only fill one in when the profile has none, so zaps can find them. + if (!merged.lud16) { + const addr = hook('namesAddress'); + if (addr) merged.lud16 = addr; + } if (merged.name) merged.display_name = merged.name; const partial = { kind: 0, content: JSON.stringify(merged), tags: [], created_at: Math.floor(Date.now() / 1000) }; const evt = id.signer instanceof Uint8Array ? finalizeEvent(partial, id.signer) : await id.signer.signEvent(partial); @@ -919,7 +926,6 @@ export function messagesFeature(ctx) { name: full.display_name || full.name || '', about: full.about || '', picture: full.picture || '', - lud16: full.lud16 || (hook('namesAddress') || ''), }; } const name = displayName(pk); @@ -963,7 +969,6 @@ export function messagesFeature(ctx) { field(t('profName'), 'name'), field(t('profAbout'), 'about'), field(t('profPicture'), 'picture', 'https://…'), - field(t('profLud16'), 'lud16', 'you@coinos.io'), h('button', { class: 'btn-primary btn-block', disabled: ui.profSaving, onClick: saveProfile }, ui.profSaving ? h('span', { class: 'spinner sm' }) : t('save'))) : mine diff --git a/src/i18n.js b/src/i18n.js index fe1e70a..c23d950 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -182,7 +182,6 @@ const STR = { profName: 'Name', profAbout: 'About', profPicture: 'Picture URL', - profLud16: 'Lightning address', profSaved: 'Profile published', msgSearching: 'Searching…', msgNoMatches: 'No matches', -- cgit v1.2.3