fix(frontend): only show weapon-type chips when item type is Weapons

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-07-15 08:48:27 +02:00
parent d6fa0fa9b0
commit 29f8bec046

View file

@ -15,7 +15,7 @@ export function ActiveChips({ search }: { search: InventorySearch }) {
label: f.itemType[0].toUpperCase() + f.itemType.slice(1), label: f.itemType[0].toUpperCase() + f.itemType.slice(1),
remove: () => update({ itemType: 'all', weaponTypes: [] }), remove: () => update({ itemType: 'all', weaponTypes: [] }),
}); });
for (const wt of f.weaponTypes) { if (f.itemType === 'weapon') for (const wt of f.weaponTypes) {
const label = WEAPON_TYPES.find(w => w.value === wt)?.label ?? wt; const label = WEAPON_TYPES.find(w => w.value === wt)?.label ?? wt;
chips.push({ label, remove: () => update({ weaponTypes: f.weaponTypes.filter(x => x !== wt) }) }); chips.push({ label, remove: () => update({ weaponTypes: f.weaponTypes.filter(x => x !== wt) }) });
} }