aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-24 17:46:32 -0700
committerAdam Soltys <[email protected]>2026-09-24 17:46:32 -0700
commit6880c72b10e7e25d960646bcabffa6b40bfd37da (patch)
tree0e459dde1cf1da6d20abb2c0df7f4b8b5b7007fe /src
parente4ed03b5caa874fad189c6a90b3e09da5530d58d (diff)
downloadcoinosv3-6880c72b10e7e25d960646bcabffa6b40bfd37da.tar.gz
coinosv3-6880c72b10e7e25d960646bcabffa6b40bfd37da.zip
Sign-in lands on Receive: a freshly opened wallet shows its deposit address and QR.
Creating, importing, unlocking or switching to an account (and finishing the onboarding wizard) now opens the Receive tab instead of History. A refresh still resumes wherever you were; loading a seed into a watch-only wallet mid-flow keeps its place too. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/app.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/app.js b/src/app.js
index e00e7e0..8a96334 100644
--- a/src/app.js
+++ b/src/app.js
@@ -1462,8 +1462,13 @@ async function activateAccount(acc, opts = {}) {
// Restore the tab / open tx from the last session so a refresh keeps the
// user's place. A gift link always opens the claim screen instead.
const nav = (() => { try { return JSON.parse(sessionStorage.getItem(NAV_KEY) || 'null'); } catch { return null; } })();
- ui.tab = (!opts.gift && nav && nav.tab) || 'history';
- ui.txDetail = (!opts.gift && nav && nav.txDetail) || null;
+ // With no place to return to, a wallet that was just opened — a sign-in,
+ // an unlock, a switch to another account — lands on Receive: its deposit
+ // address and QR up at once. Reopening the same wallet mid-flow (a seed
+ // loaded into a watch-only one) keeps History.
+ const keep = nav && (opts.restoreNav || !opts.fresh); // a sign-in starts fresh, a refresh resumes
+ ui.tab = (!opts.gift && keep && nav.tab) || (opts.fresh ? 'receive' : 'history');
+ ui.txDetail = (!opts.gift && keep && nav.txDetail) || null;
// Not baselined yet — stays null until the scan + ack logic below sets it,
// so the celebration never fires for payments that were already there at
// import (the index only looks "advanced" because the scan hadn't run yet).
@@ -1787,7 +1792,8 @@ function removeAccount(id) {
function switchAccount(id) {
const acc = accounts.find((a) => a.id === id);
- if (acc) activateAccount(acc, { fresh: true });
+ if (!acc) return;
+ activateAccount(acc, { fresh: true });
}
// Restore accounts after a refresh (sessionStorage); on a fresh session, prompt
@@ -3335,7 +3341,7 @@ function onboardScreen() {
// Spending stays out of sight until the user sets it up.
ui.account = 'savings';
try { localStorage.setItem(ACCOUNT_KEY, 'savings'); } catch {}
- ui.tab = 'history';
+ ui.tab = 'receive';
return null; // the caller falls through to the wallet itself
}
}
@@ -3455,7 +3461,7 @@ function onboardScreen() {
try { localStorage.removeItem(ONB_STEP_KEY); } catch {}
ui.account = 'savings';
try { localStorage.setItem(ACCOUNT_KEY, 'savings'); } catch {}
- ui.tab = 'history';
+ ui.tab = 'receive';
render();
};
return page([
@@ -3474,7 +3480,7 @@ function onboardScreen() {
try { localStorage.removeItem(ONB_STEP_KEY); } catch {}
ui.account = 'savings';
try { localStorage.setItem(ACCOUNT_KEY, 'savings'); } catch {}
- ui.tab = 'history';
+ ui.tab = 'receive';
render();
} }, t('onbBackupLater')),
]);
@@ -3510,7 +3516,7 @@ function onboardScreen() {
try { localStorage.removeItem(ONB_STEP_KEY); } catch {}
ui.account = 'savings';
try { localStorage.setItem(ACCOUNT_KEY, 'savings'); } catch {}
- ui.tab = 'history';
+ ui.tab = 'receive';
render();
} }, t('onbNotNow')),
]);
@@ -3618,7 +3624,7 @@ function onboardScreen() {
ui.account = 'spending';
try { localStorage.setItem(ACCOUNT_KEY, 'spending'); } catch {}
}
- ui.tab = 'history';
+ ui.tab = 'receive';
render();
} }, t('onbEnter')),
h('button', { class: 'btn-ghost btn-block', onClick: () => { o.step = 'avatar'; render(); } }, t('back')),