aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app.js3
-rw-r--r--src/features/messages.js11
2 files changed, 14 insertions, 0 deletions
diff --git a/src/app.js b/src/app.js
index cc30cee..f5337b6 100644
--- a/src/app.js
+++ b/src/app.js
@@ -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