Skip to content

Commit

Permalink
fix: title with 4 cards combos
Browse files Browse the repository at this point in the history
  • Loading branch information
ldeluigi committed Oct 17, 2024
1 parent a822b47 commit d8e81e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/combo/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ const Combo: React.FC<Props> = ({ combo, alternatives, previewImageUrl }) => {
const templateNamesWithQuantities = combo.requires.map((template) =>
template.quantity > 1 ? `${template.quantity}x ${template.template.name}` : template.template.name,
);
const totalCount = titleCount + combo.requires.reduce((a, b) => a + b.quantity, 0);
const totalCount =
combo.uses.reduce((a, b) => a + b.quantity, 0) + combo.requires.reduce((a, b) => a + b.quantity, 0);
console.log(titleCount, totalCount);
const subtitle =
totalCount === titleCount
? ''
Expand Down

0 comments on commit d8e81e2

Please sign in to comment.