From 81aa5c0c6b6f7df5801b48aab6185eba85328852 Mon Sep 17 00:00:00 2001 From: abimbolaalabi Date: Fri, 26 Jun 2026 22:27:02 +0100 Subject: [PATCH 1/3] refactor(bounty-card): remove unsafe Bounty casts for slot counts --- components/bounty/bounty-card.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/components/bounty/bounty-card.tsx b/components/bounty/bounty-card.tsx index f0f5c8a5..5f68ebb7 100644 --- a/components/bounty/bounty-card.tsx +++ b/components/bounty/bounty-card.tsx @@ -13,14 +13,18 @@ import { Clock, Users, Zap } from "lucide-react"; import { cn } from "@/lib/utils"; import { formatDistanceToNow } from "date-fns"; import { BountyFieldsFragment } from "@/lib/graphql/generated"; -import type { Bounty } from "@/types/bounty"; import { EscrowStatus } from "./escrow-status"; import { useEscrowPool } from "@/hooks/use-escrow"; import { getRoundPhase } from "@/hooks/use-lightning-rounds"; import { BookmarkButton } from "./bookmark-button"; +type CardBounty = BountyFieldsFragment & { + totalSlotsOccupied?: number | null; + maxSlots?: number | null; +}; + interface BountyCardProps { - bounty: BountyFieldsFragment; + bounty: CardBounty; onClick?: () => void; variant?: "grid" | "list"; } @@ -229,7 +233,7 @@ export function BountyCard({ {bounty.type === "MULTI_WINNER_MILESTONE" && ( - {(bounty as unknown as Bounty).totalSlotsOccupied ?? 0} / {(bounty as unknown as Bounty).maxSlots ?? 5} slots + {bounty.totalSlotsOccupied ?? 0} / {bounty.maxSlots ?? 5} slots )} @@ -267,4 +271,4 @@ export function BountyCard({ ); -} \ No newline at end of file +} From 128d4239caf14db1c516b3be90a47c2afd113367 Mon Sep 17 00:00:00 2001 From: abimbolaalabi Date: Sat, 27 Jun 2026 08:59:24 +0100 Subject: [PATCH 2/3] refactor(bounty-card): remove unsafe Bounty casts for slot counts --- components/bounty/bounty-card.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/bounty/bounty-card.tsx b/components/bounty/bounty-card.tsx index 5f68ebb7..b1da9ba4 100644 --- a/components/bounty/bounty-card.tsx +++ b/components/bounty/bounty-card.tsx @@ -13,18 +13,16 @@ import { Clock, Users, Zap } from "lucide-react"; import { cn } from "@/lib/utils"; import { formatDistanceToNow } from "date-fns"; import { BountyFieldsFragment } from "@/lib/graphql/generated"; +import type { Bounty } from "@/types/bounty"; import { EscrowStatus } from "./escrow-status"; import { useEscrowPool } from "@/hooks/use-escrow"; import { getRoundPhase } from "@/hooks/use-lightning-rounds"; import { BookmarkButton } from "./bookmark-button"; -type CardBounty = BountyFieldsFragment & { - totalSlotsOccupied?: number | null; - maxSlots?: number | null; -}; +type CardBounty = BountyFieldsFragment & Partial; interface BountyCardProps { - bounty: CardBounty; + bounty: BountyFieldsFragment; onClick?: () => void; variant?: "grid" | "list"; } @@ -97,6 +95,7 @@ export function BountyCard({ const isFcfsClaimed = bounty.type === "FIXED_PRICE" && normalizedStatus === "IN_PROGRESS"; const isCompetition = bounty.type === "COMPETITION"; + const cardBounty = bounty as CardBounty; // claimCount and maxParticipants are pending backend schema fields; use safe fallbacks. const slotCount = bounty._count?.submissions ?? 0; const maxParticipants = null; @@ -233,7 +232,8 @@ export function BountyCard({ {bounty.type === "MULTI_WINNER_MILESTONE" && ( - {bounty.totalSlotsOccupied ?? 0} / {bounty.maxSlots ?? 5} slots + {cardBounty.totalSlotsOccupied ?? 0} /{" "} + {cardBounty.maxSlots ?? 5} slots )} From a79bb497444b2da43a63b092aa64bd634f1cfdbe Mon Sep 17 00:00:00 2001 From: abimbolaalabi Date: Sun, 28 Jun 2026 12:56:46 +0100 Subject: [PATCH 3/3] refactor(bounty-card): remove unsafe Bounty casts for slot counts --- components/bounty/bounty-card.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/bounty/bounty-card.tsx b/components/bounty/bounty-card.tsx index b1da9ba4..1345e110 100644 --- a/components/bounty/bounty-card.tsx +++ b/components/bounty/bounty-card.tsx @@ -19,10 +19,11 @@ import { useEscrowPool } from "@/hooks/use-escrow"; import { getRoundPhase } from "@/hooks/use-lightning-rounds"; import { BookmarkButton } from "./bookmark-button"; -type CardBounty = BountyFieldsFragment & Partial; +type CardBounty = BountyFieldsFragment & + Partial>; interface BountyCardProps { - bounty: BountyFieldsFragment; + bounty: CardBounty; onClick?: () => void; variant?: "grid" | "list"; } @@ -95,7 +96,6 @@ export function BountyCard({ const isFcfsClaimed = bounty.type === "FIXED_PRICE" && normalizedStatus === "IN_PROGRESS"; const isCompetition = bounty.type === "COMPETITION"; - const cardBounty = bounty as CardBounty; // claimCount and maxParticipants are pending backend schema fields; use safe fallbacks. const slotCount = bounty._count?.submissions ?? 0; const maxParticipants = null; @@ -232,8 +232,7 @@ export function BountyCard({ {bounty.type === "MULTI_WINNER_MILESTONE" && ( - {cardBounty.totalSlotsOccupied ?? 0} /{" "} - {cardBounty.maxSlots ?? 5} slots + {bounty.totalSlotsOccupied ?? 0} / {bounty.maxSlots ?? 5} slots )}