From dd3ca845bfaf901dfb0fe702a7e5cb1c32485d25 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 10 Sep 2026 10:40:16 -0700 Subject: Onboarding: fix the crash after a name claim/migration; keep a login-owned name through signer resume. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Something broke" right after a coinos.io migration completed: the spend step advances past the avatar ask by calling nextAfterAvatar(), which was a const declared further down the same function — a temporal-dead-zone throw for any profile that already had a picture. Now a hoisted function. Also, the claimed-name ownership check only counted the LIVE login signer. A bunker/Google login resumes seconds after load, so for that window a name owned by the login identity (every migrated coinos.io name) looked foreign, was dropped, and the wallet key's npub-shaped default took its place — the address visibly flipped from name@coinos.io to npub…@coinos.io. The stored login pubkey now counts as ours too. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Nw1Dijik1tLVKRM1WkU7xE --- src/app.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/app.js') diff --git a/src/app.js b/src/app.js index 35fd225..9bedd2c 100644 --- a/src/app.js +++ b/src/app.js @@ -2879,10 +2879,16 @@ function onboardScreen() { // After the identity niceties: offer a first top-up when Savings can fund // one and Spending is empty-handed — a spending account with nothing in it // is a demo, not a wallet. - const nextAfterAvatar = () => - (featureHook('arkReady') && wallet.spendable > 1000 + // A function declaration, not a const: the spend step above calls this + // while advancing past the avatar ask, i.e. BEFORE this line runs — a + // const there is in its temporal dead zone and threw "Cannot access + // before initialization", crashing onboarding right after a name claim or + // a coinos.io migration landed (a profile with a picture took this path). + function nextAfterAvatar() { + return (featureHook('arkReady') && wallet.spendable > 1000 && (featureHook('spendingSat') || 0) + (featureHook('spendingBoardingSat') || 0) < 1000) ? 'board' : 'success'; + } if (o.step === 'legacy') { // The migrate link carries this wallet's payment address, which the -- cgit v1.2.3