Skip to content

Commit

Permalink
fix: if no passport rounds in cart, act as if passport is valid (#2795)
Browse files Browse the repository at this point in the history
  • Loading branch information
vacekj authored Jan 10, 2024
1 parent 1750385 commit e5a5111
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ export function MatchingEstimateTooltip(props: { isEligible: boolean }) {
</>
) : (
<>
Keep in mind that this is a potential match. By connecting to
Gitcoin Passport, you can update your score before or after
submitting your donation.{" "}
Keep in mind that this is a potential match that may change with
the number of donations to a round.
<a
href="https://passport.gitcoin.co"
className={"underline"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ export function SummaryContainer() {
return null;
}

const noPassportRoundsInCart =
rounds?.filter(
(round) => round.roundMetadata?.quadraticFundingConfig?.sybilDefense
).length === 0;

return (
<div className="mb-5 block px-[16px] py-4 rounded-lg shadow-lg bg-white border border-violet-400 font-semibold sticky top-20">
<h2 className="text-xl border-b-2 pb-2">Summary</h2>
Expand All @@ -420,7 +425,8 @@ export function SummaryContainer() {
<p>Estimated match</p>
<MatchingEstimateTooltip
isEligible={
passportScore !== undefined && passportScore >= 15
(passportScore !== undefined && passportScore >= 15) ||
noPassportRoundsInCart
}
/>
</div>
Expand Down Expand Up @@ -470,9 +476,10 @@ export function SummaryContainer() {

/* Check if user hasn't connected passport yet, display the warning modal */
if (
passportState === PassportState.ERROR ||
passportState === PassportState.NOT_CONNECTED ||
passportState === PassportState.INVALID_PASSPORT
(passportState === PassportState.ERROR ||
passportState === PassportState.NOT_CONNECTED ||
passportState === PassportState.INVALID_PASSPORT) &&
!noPassportRoundsInCart
) {
setDonateWarningModalOpen(true);
return;
Expand Down

5 comments on commit e5a5111

@vercel
Copy link

@vercel vercel bot commented on e5a5111 Jan 10, 2024

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

builder – ./packages/builder

builder-kappa-one.vercel.app
builder.gitcoin.co
builder-git-main-grants-stack.vercel.app
builder-grants-stack.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e5a5111 Jan 10, 2024

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

manager – ./packages/round-manager

manager-git-main-grants-stack.vercel.app
manager-grants-stack.vercel.app
grants-stack-round-manager.vercel.app
manager.gitcoin.co

@vercel
Copy link

@vercel vercel bot commented on e5a5111 Jan 10, 2024

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

explorer-staging – ./packages/grant-explorer

grants-stack-explorer-staging.vercel.app
explorer-staging-grants-stack.vercel.app
explorer-staging-git-main-grants-stack.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e5a5111 Jan 10, 2024

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

manager-staging – ./packages/round-manager

manager-staging-git-main-grants-stack.vercel.app
manager-staging-grants-stack.vercel.app
grants-stack-manager-staging.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e5a5111 Jan 10, 2024

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

builder-staging – ./packages/builder

builder-staging-grants-stack.vercel.app
grants-stack-builder-staging.vercel.app
builder-staging-git-main-grants-stack.vercel.app

Please sign in to comment.