aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-17 23:53:15 -0700
committerAdam Soltys <[email protected]>2026-08-17 23:53:15 -0700
commit373566416e6a3ce8ff83aafcd6afc96147a01580 (patch)
treec3a67d30a03ba9af840a300c90ba06e5db4e7cf0 /src
parent5a9deb5688ee560c2b020582d43dddbed0cda873 (diff)
downloadcoinosv3-373566416e6a3ce8ff83aafcd6afc96147a01580.tar.gz
coinosv3-373566416e6a3ce8ff83aafcd6afc96147a01580.zip
The avatar ask learns to recognize a face: an identity with a published picture skips the punk picker and lands straight on done
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz
Diffstat (limited to 'src')
-rw-r--r--src/app.js9
-rw-r--r--src/features/messages.js3
2 files changed, 11 insertions, 1 deletions
diff --git a/src/app.js b/src/app.js
index 063da05..8f5c622 100644
--- a/src/app.js
+++ b/src/app.js
@@ -2696,7 +2696,14 @@ function onboardScreen() {
if (o.enterAddr === undefined) o.enterAddr = addr || null;
// Only a real (custom) name advances by itself — the background
// auto-claim of the npub-shaped default doesn't count as setting up.
- if (addr && addr !== o.enterAddr && !/^npub1/.test(addr)) o.step = 'avatar';
+ if (addr && addr !== o.enterAddr && !/^npub1/.test(addr)) {
+ // The avatar ask is for brand-new profiles. An identity that already
+ // wears a face (a nostr login with a published picture) skips straight
+ // to done — the punk picker restyling a real profile helps nobody.
+ const me = (featureHook('nostrLoginIdentity') || {}).pubkey || (wallet.nostrPubkey && wallet.nostrPubkey());
+ const prof = me ? featureHook('cachedProfile', me) : null;
+ o.step = prof && prof.picture ? 'success' : 'avatar';
+ }
}
try { localStorage.setItem(ONB_STEP_KEY, o.step); } catch {}
const page = (kids) => h('div', { class: 'col onb', style: 'gap:20px' }, ...kids);
diff --git a/src/features/messages.js b/src/features/messages.js
index a89854a..4202a75 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -2314,6 +2314,9 @@ export function messagesFeature(ctx) {
// Anyone (ark's history, other features) can open a profile or render a
// small clickable identity chip.
showProfile(pk) { openProfile(pk); return true; },
+ // The light profile cache, read-only — lets the onboarding wizard skip
+ // asks (like the avatar picker) that a loaded identity already answered.
+ cachedProfile(pk) { return profileOf(pk); },
// Publish (merge) kind-0 fields for the current identity — the onboarding
// wizard sets name + picture through this.
publishProfile(fields, opts = {}) { return publishProfileFields(fields, opts); },