Skip to content

Commit

Permalink
fix: logic
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum committed Oct 18, 2024
1 parent 4e9a60c commit 73e9e6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/utils/hooks/offers/useOffers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function useOffers(
...options.overrides,
// if there is a offer list defined at .env level, then use that or the intersection with the overrides
// otherwise, use the overrides offer list
offerCurationList: offerlistFromCuration
offerCurationList: offerlistFromCuration?.length
? options.overrides?.offerCurationList
? options.overrides.offerCurationList.filter((o) =>
offerlistFromCuration.includes(o)
Expand Down
6 changes: 4 additions & 2 deletions src/pages/landing/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ export default function Landing() {
{
voided: false,
valid: true,
quantityAvailable_gte: 1
quantityAvailable_gte: 1,
first: offersWhitelisted?.length || 0
},
{
enabled: !!offersWhitelisted?.length,
Expand Down Expand Up @@ -187,7 +188,8 @@ export default function Landing() {
return offers
.map((offer) => {
const { mainImage } = getOfferDetails(offer.metadata);
return mainImage || offer?.metadata?.imageUrl;
const img = mainImage || offer?.metadata?.imageUrl;
return img;
})
.filter(isTruthy);
}, [validOffersWhitelisted, shuffledOffers]);
Expand Down

0 comments on commit 73e9e6f

Please sign in to comment.