diff options
Diffstat (limited to 'src/features')
| -rw-r--r-- | src/features/messages.js | 16 | ||||
| -rw-r--r-- | src/features/names.js | 4 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 637c2d1..2249c8f 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -2620,13 +2620,15 @@ export function messagesFeature(ctx) { // 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(() => {}); + // Synchronous on purpose: identity() can await a signer resume, and + // the header sat avatar-less for that beat. A generated seed's pubkey + // is right here — paint the punk before the next frame. + const pk = (hook('nostrLoginIdentity') || {}).pubkey || (wallet.nostr && wallet.nostr.pk); + if (!pk) return; + const entry = { name: null, picture: null, t: Date.now() }; + profiles.set(pk, entry); + persistProfile(pk, entry); + scheduleRepaint(); }, headerAvatar(pk) { // A fresh node every render: the morph keeps the live element (and its diff --git a/src/features/names.js b/src/features/names.js index ac54079..f794790 100644 --- a/src/features/names.js +++ b/src/features/names.js @@ -771,6 +771,10 @@ export function namesFeature(ctx) { // 'pending' while the restore/claim pass is still running — the wallet // screen holds spending-setup prompts until the name question is settled. namesSettled() { return checked ? 'yes' : 'pending'; }, + // A seed minted seconds ago has nothing to restore anywhere: don't make + // the spending-setup ask wait out registrar round trips that only exist + // for wallets with a history. The background claim still runs. + identityGenerated() { checked = true; }, // 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) |
