aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/hats.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-11-22 09:57:40 -0700
committerAdam Soltys <[email protected]>2026-11-22 09:57:40 -0700
commit2772773d6d1b214eaf435f56e439ef8ec56b9bed (patch)
tree1034d1de2ee321af8dd836979ba1621db6da36ee /src/features/hats.js
parentf39513ec0a1bc178d8569116286f2b5b90ef3822 (diff)
downloadcoinosv3-2772773d6d1b214eaf435f56e439ef8ec56b9bed.tar.gz
coinosv3-2772773d6d1b214eaf435f56e439ef8ec56b9bed.zip
v3.coinos.io/hats opens the hat shop. "Someone in the coinos group is asking where to get hats. Can we make the hat shop have a linkable url like v3.coinos.io/hats that I can direct him to?" (Adam, 2026-11-22). The shop was a screen with no address, reached from the profile editor or the About page. The /hats path now opens it once a wallet is up; someone who arrives with no wallet gets the way in first and the shop when the wallet is made. The address bar says /hats for as long as the shop is on screen, so the link can be copied from there, and goes back to / when the shop is left. New hats-link-test passes (no wallet, with a wallet, the bar, leaving); features-smoke passes.
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6Upic5L6MMJzkTn8zg
Diffstat (limited to 'src/features/hats.js')
-rw-r--r--src/features/hats.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/features/hats.js b/src/features/hats.js
index 932f908..a00f285 100644
--- a/src/features/hats.js
+++ b/src/features/hats.js
@@ -481,6 +481,15 @@ export function hatsFeature(ctx) {
node,
h('span', { class: 'ava-hat', style: posStyle(hat), html: hat.art }));
},
+ // A wallet just opened: the /hats link lands in the shop.
+ init() {
+ if (!ui.hatsAtBoot) return;
+ ui.hatsAtBoot = false;
+ ui.screen = 'wallet';
+ openShop();
+ },
+ // ...and the shop's address is /hats for as long as it is on screen
+ navPath(snap) { return snap && snap.screen === 'wallet' && snap.hatShop ? '/hats' : null; },
// The footer's "Show your support" link: straight into the shop.
openHatShop() { openShop(); try { window.scrollTo(0, 0); } catch {} return true; },
// Own-profile editor entry: the door to the shop.