The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Misc. bounties fixes
Tim Wilson54bba4828cda
diff --git a/apps/web/app/(ee)/api/cron/payouts/create-payout.ts b/apps/web/app/(ee)/api/cron/payouts/create-payout.tsindex 61e8f4f85f..fd640b9937 100644--- a/apps/web/app/(ee)/api/cron/payouts/create-payout.ts+++ b/apps/web/app/(ee)/api/cron/payouts/create-payout.ts@@ -62,7 +62,7 @@ export const createPayout = async ({const [commissions, clawbacks] = await Promise.all([// Find all pending commissions- // We only process commissions that were created before the holding period+ // We only process commissions that are custom or were created before the holding periodprisma.commission.findMany({where: {earnings: {@@ -70,9 +70,18 @@ export const createPayout = async ({},...commonWhere,...(holdingPeriodDays > 0 && {- createdAt: {- lt: new Date(Date.now() - holdingPeriodDays * 24 * 60 * 60 * 1000),- },+ OR: [+ {+ createdAt: {+ lt: new Date(+ Date.now() - holdingPeriodDays * 24 * 60 * 60 * 1000,+ ),+ },+ },+ {+ type: "custom", // Custom commissions skip the holding period+ },+ ],}),},select: {diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submission-details-sheet.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submission-details-sheet.tsxindex bf690f40af..4e184025eb 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submission-details-sheet.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submission-details-sheet.tsx@@ -45,7 +45,7 @@ function BountySubmissionDetailsSheetContent({onSuccess: async () => {toast.success("Bounty submission approved successfully!");setIsOpen(false);- await mutatePrefix(`/api/bounties/${bounty?.id}/submissions`);+ await mutatePrefix("/api/bounties");},onError({ error }) {toast.error(error.serverError);diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submissions-table.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submissions-table.tsxindex 190de13994..611b624dc0 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submissions-table.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submissions-table.tsx@@ -426,7 +426,7 @@ function RowMenuButton({onSuccess: async () => {toast.success("Bounty submission approved successfully!");setIsOpen(false);- await mutatePrefix(`/api/bounties/${bountyId}/submissions`);+ await mutatePrefix("/api/bounties");},onError({ error }) {toast.error(error.serverError);diff --git a/apps/web/lib/actions/partners/create-bounty-submission.ts b/apps/web/lib/actions/partners/create-bounty-submission.tsindex a14d392dbf..4fce606383 100644--- a/apps/web/lib/actions/partners/create-bounty-submission.ts+++ b/apps/web/lib/actions/partners/create-bounty-submission.ts@@ -104,7 +104,7 @@ export const createBountySubmissionAction = authPartnerActionClient// Validate the submission requirementsconst submissionRequirements = submissionRequirementsSchema.parse(- bounty.submissionRequirements,+ bounty.submissionRequirements || [],);const requireImage = submissionRequirements.includes("image");diff --git a/apps/web/ui/partners/bounties/claim-bounty-modal.tsx b/apps/web/ui/partners/bounties/claim-bounty-modal.tsxindex bbc544f786..32552b4b7f 100644--- a/apps/web/ui/partners/bounties/claim-bounty-modal.tsx+++ b/apps/web/ui/partners/bounties/claim-bounty-modal.tsx@@ -444,7 +444,12 @@ function ClaimBountyModalContent({variant="primary"text={isFormOpen ? "Submit proof" : "Claim bounty"}className="grow rounded-lg"- onClick={isFormOpen ? undefined : () => setIsFormOpen(true)}+ onClick={+ isFormOpen+ ? undefined+ : // Delay open to prevent also submitting the form+ () => setTimeout(() => setIsFormOpen(true), 100)+ }loading={isPending}disabled={isFormOpen &&