From 82165619f9a6a7090f97d15cff4e1b1dd48b8dee Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 18 Aug 2026 07:38:21 -0700 Subject: 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz --- src/features/hats.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/features') 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'))); } -- cgit v1.2.3