Conversation
📝 WalkthroughWalkthroughThis pull request refactors the home page's minting section to conditionally display either the current NFT being minted or the next upcoming drop based on minting status. It introduces new hooks ( Changes
Sequence DiagramsequenceDiagram
participant User
participant LatestDropSection
participant useNowMintingStatus
participant useNextMintDrop
participant shouldShowNextMintInLatestDrop
participant NowMintingSection
participant LatestDropNextMintSection
User->>LatestDropSection: Load page
LatestDropSection->>useNowMintingStatus: Fetch current minting status
useNowMintingStatus-->>LatestDropSection: { nft, isFetching, status }
LatestDropSection->>useNextMintDrop: Fetch next mint drop data
useNextMintDrop-->>LatestDropSection: { nextMint, waveId, isReady }
alt Decision ready
LatestDropSection->>shouldShowNextMintInLatestDrop: Check visibility
shouldShowNextMintInLatestDrop-->>LatestDropSection: shouldShowNextMint boolean
alt Should show next mint
LatestDropSection->>LatestDropNextMintSection: Render with nextMint drop
LatestDropNextMintSection-->>User: Display next mint card
else Show current mint
LatestDropSection->>NowMintingSection: Render with current NFT
NowMintingSection-->>User: Display now minting section
end
else Not ready
LatestDropSection->>NowMintingSection: Render with undefined NFT
NowMintingSection-->>User: Display loading state
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@components/home/next-mint-leading/NextMintLeadingSection.tsx`:
- Around line 49-52: The showNextMint boolean is inverted: currently it hides
the next mint when the current mint has ended. Change its definition to show the
next mint when a nextMint exists AND (the current mint has ended OR the next
mint is not the same as the now minting). Update the expression for showNextMint
(referencing isNowMintingEnded, nextMint, and isNextMintSameAsNowMinting) to use
(isNowMintingEnded || !isNextMintSameAsNowMinting) so leadingCount continues to
derive from showNextMint correctly.
In `@components/home/now-minting/LatestDropNextMintSection.tsx`:
- Around line 46-56: The code assumes arrays exist and can throw; update the
media, title, and description computations to safely handle missing arrays by
adding guards: when computing media (const media = ...), check drop.parts is an
array and drop.parts[0]?.media is an array before indexing; when computing title
and description, guard drop.metadata is an array before calling find (e.g., use
Array.isArray(drop.metadata) && drop.metadata.find(...)?...); ensure
authorHandle/authorName logic remains unchanged. Locate symbols: media, title,
description, and the use of drop.metadata and drop.parts in
LatestDropNextMintSection and replace direct indexing/find usage with these safe
checks.
In `@hooks/useNextMintDrop.ts`:
- Around line 14-28: seizeSettings and nextMint.metadata can be undefined during
loading causing runtime crashes; update the logic around
useSeizeSettings/useWaveDecisions and the derivation of
latestDecision/nextMint/nextMintTitle to defensively guard optional values:
ensure waveId is derived only when seizeSettings and seizeSettings.memes_wave_id
exist before calling useWaveDecisions, check decisionPoints length before
accessing decisionPoints[decisionPoints.length - 1], use optional chaining
(e.g., latestDecision?.winners?.[0]?.drop) and safe access for metadata (e.g.,
nextMint?.metadata?.find(...)) and fall back to null/defaults for nextMint and
nextMintTitle to avoid throws.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/home/next-mint-leading/NextMintLeadingSection.tsx (1)
42-55:⚠️ Potential issue | 🟡 MinorUse stable IDs to detect “same drop” instead of titles.
The title/name comparison can misidentify the same drop when metadata differs or is missing, causing the current mint to show again as “Next Mint.” Prefer comparing IDs when available, with a title fallback only if IDs are absent.
🔁 Suggested fix
- const isNextMintSameAsNowMinting = - !!nowMinting?.name && - !!nextMintTitle && - nowMinting.name.toLowerCase().trim() === nextMintTitle.toLowerCase().trim(); + const isNextMintSameAsNowMinting = + (!!nowMinting?.id && !!nextMint?.id && nowMinting.id === nextMint.id) || + (!!nowMinting?.name && + !!nextMintTitle && + nowMinting.name.toLowerCase().trim() === + nextMintTitle.toLowerCase().trim());
🤖 Fix all issues with AI agents
In `@components/home/now-minting/LatestDropSection.tsx`:
- Around line 22-24: The current check in LatestDropSection returns a loading
NowMintingSection with nft={undefined} whenever isDecisionReady is false, which
hides the already-fetched current mint; instead, keep showing the real current
mint by rendering NowMintingSection with the existing nft and an isFetching flag
(e.g., nft={nft} isFetching={true}) until you’re ready to swap. Locate the
conditional that references isDecisionReady in LatestDropSection and change the
return so it passes through the current nft and sets isFetching appropriately
rather than forcing nft={undefined}. Ensure props names match NowMintingSection
(nft and isFetching) so the current mint remains visible while next-mint
readiness completes.
|



Summary by CodeRabbit
Release Notes
New Features
Refactor