Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update partner-application-sheet.tsx

Tim Wilson6ddd6b141c00
diff --git a/apps/web/ui/partners/partner-application-sheet.tsx b/apps/web/ui/partners/partner-application-sheet.tsx
index f39087d283..96ccb975d4 100644
--- a/apps/web/ui/partners/partner-application-sheet.tsx
+++ b/apps/web/ui/partners/partner-application-sheet.tsx
@@ -20,7 +20,7 @@ import { ProgramApplication } from "@prisma/client";
import Linkify from "linkify-react";
import { useAction } from "next-safe-action/hooks";
import Link from "next/link";
-import { Dispatch, SetStateAction, useState } from "react";
+import { Dispatch, SetStateAction, useEffect, useState } from "react";
import { toast } from "sonner";
import useSWRImmutable from "swr/immutable";
import { PartnerAbout } from "./partner-about";
@@ -48,6 +48,11 @@ function PartnerApplicationSheetContent({
partner.groupId ?? null,
);
+ // Reset selection when navigating between partners
+ useEffect(() => {
+ setSelectedGroupId(partner.groupId ?? null);
+ }, [partner.groupId]);
+
return (
<div className="flex size-full flex-col">
<div className="flex h-16 shrink-0 items-center justify-between border-b border-neutral-200 px-6 py-4">