diff options
| author | Adam Soltys <[email protected]> | 2026-08-15 17:19:28 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-15 17:19:28 -0700 |
| commit | 18786c7774e817b6a55c27017c8f719c2197afcb (patch) | |
| tree | a3e40cc0264bff7493b3d55f4584cd08690f891d | |
| parent | b269935af4d3b2fdc71b5f52340b25b9cb7d8da8 (diff) | |
| download | coinosv3-18786c7774e817b6a55c27017c8f719c2197afcb.tar.gz coinosv3-18786c7774e817b6a55c27017c8f719c2197afcb.zip | |
A newborn identity knows it has no portrait: fresh seeds skip the kind-0 wait and the punk paints the moment home appears
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014tE4U5nEjGTQy8PwYqamfv
| -rw-r--r-- | src/app.js | 3 | ||||
| -rw-r--r-- | src/features/messages.js | 11 |
2 files changed, 14 insertions, 0 deletions
@@ -1017,6 +1017,9 @@ async function activateAccount(acc, opts = {}) { persistAccounts(); autoSave(acc); for (const f of FEATURES) { try { f.init && f.init(); } catch {} } // per-feature wallet lifecycle + // A freshly generated identity provably has no profile yet — let features + // skip the "is there a kind-0?" wait (avatar would sit blank meanwhile). + if (opts.generated) featureHook('identityGenerated'); const hadCache = wallet.restoreCache(); // show last-known balance/history instantly // An opened gift link starts on a claim/back-up screen instead of the wallet. ui.screen = opts.gift ? 'claim' : 'wallet'; diff --git a/src/features/messages.js b/src/features/messages.js index 890fbb5..08ec8cf 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -2158,6 +2158,17 @@ export function messagesFeature(ctx) { // the picture visibly flash during boot's render bursts. There is exactly // one header avatar, so the node itself is reused until the profile // (or account) actually changes. + // A seed minted seconds ago has no kind-0 anywhere — don't make the + // avatar sit white while a relay lookup confirms that; paint the punk now. + identityGenerated() { + identity().then((id) => { + if (!id) return; + const entry = { name: null, picture: null, t: Date.now() }; + profiles.set(id.pubkey, entry); + persistProfile(id.pubkey, entry); + scheduleRepaint(); + }).catch(() => {}); + }, headerAvatar(pk) { // A fresh node every render: the morph keeps the live element (and its // loaded image) in place when nothing changed, which is exactly what |
