Skip to content

Commit

Permalink
Fix settings NFT state where delegate exists but there are no tiers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyd-eth authored Oct 12, 2023
1 parent 984899a commit d0ab14a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export function EditNftsPage() {
const { projectOwnerAddress, fundingCycleMetadata } =
useContext(V2V3ProjectContext)
const hasExistingNfts =
fundingCycleMetadata?.dataSource !== constants.AddressZero

fundingCycleMetadata?.dataSource &&
fundingCycleMetadata.dataSource !== constants.AddressZero
const nftDeployerCanReconfigure = useNftDeployerCanReconfigure({
projectId,
projectOwnerAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ export function EditNftsSection() {
setSubmitLoading(false)
}, [rewardTiers, updateExistingCollection])

// this component only renders when data source is not 0x000..
// so if there are no rewardTiers here, it's safe to assume they're still loading
const noTiers = !rewardTiers || rewardTiers.length === 0

if (loading || noTiers) return <Loading className="mt-20" />
if (loading) return <Loading className="mt-20" />

return (
<>
Expand All @@ -40,14 +36,12 @@ export function EditNftsSection() {
</Callout.Info>

<div className="mb-8">
{rewardTiers && rewardTiers.length > 0 && (
<RewardsList
value={rewardTiers}
onChange={setRewardTiers}
allowCreate
withEditWarning
/>
)}
<RewardsList
value={rewardTiers}
onChange={setRewardTiers}
allowCreate
withEditWarning
/>

{rewardTiers?.length === 0 && (
<Empty
Expand Down

2 comments on commit d0ab14a

@vercel
Copy link

@vercel vercel bot commented on d0ab14a Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on d0ab14a Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.