aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-18 07:38:21 -0700
committerAdam Soltys <[email protected]>2026-08-18 07:38:21 -0700
commit82165619f9a6a7090f97d15cff4e1b1dd48b8dee (patch)
tree72222e45691fed621a3a7683979ac6ca705fa2fa /src
parentd667411ba1466840c589f8eed9bea2f69a0bfcf1 (diff)
downloadcoinosv3-82165619f9a6a7090f97d15cff4e1b1dd48b8dee.tar.gz
coinosv3-82165619f9a6a7090f97d15cff4e1b1dd48b8dee.zip
The collection is always wearable: every owned hat offers itself in the shop — the crown included, for the one head it belongs to — so a new purchase never strands an old favourite
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz
Diffstat (limited to 'src')
-rw-r--r--src/features/hats.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/features/hats.js b/src/features/hats.js
index 4012cf3..ed89a82 100644
--- a/src/features/hats.js
+++ b/src/features/hats.js
@@ -295,9 +295,9 @@ export function hatsFeature(ctx) {
demo(hat),
h('div', { class: 'col grow', style: 'min-width:0;gap:1px' },
h('div', { class: 'chat-name' }, t(hat.nameKey)),
- hat.id === 'crown'
- ? h('div', { class: 'muted small' }, t('hatCrownWho'))
- : ownedHere ? h('div', { class: 'muted small' }, t('hatOwned')) : null),
+ ownedHere
+ ? h('div', { class: 'muted small' }, t('hatOwned'))
+ : hat.id === 'crown' ? h('div', { class: 'muted small' }, t('hatCrownWho')) : null),
action);
}
@@ -312,8 +312,10 @@ export function hatsFeature(ctx) {
d === null
? h('div', { style: 'text-align:center;padding:16px' }, h('span', { class: 'spinner' }))
: h('div', { class: 'col', style: 'gap:2px' },
- // the crown is not merchandise — it never appears in the store
- ...HATS.filter((hat) => hat.id !== 'crown').map((hat) => shopRow(hat, d, me))),
+ // the crown is not merchandise — it appears only in the
+ // collection of the head that owns it, never as a listing
+ ...HATS.filter((hat) => hat.id !== 'crown' || (d.owned || []).includes('crown'))
+ .map((hat) => shopRow(hat, d, me))),
d && d.offline ? h('div', { class: 'small faint', style: 'text-align:center' }, t('hatShopOffline')) : null),
h('button', { class: 'btn-ghost btn-block', onClick: closeShop }, t('back')));
}