The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
fix partnerlinkmodal random link key generation
Steven Tey2721ec3354ef
diff --git a/apps/web/ui/modals/partner-link-modal.tsx b/apps/web/ui/modals/partner-link-modal.tsxindex 364a3a16c2..fa431464bf 100644--- a/apps/web/ui/modals/partner-link-modal.tsx+++ b/apps/web/ui/modals/partner-link-modal.tsx@@ -227,15 +227,10 @@ function PartnerLinkModalContent({// Auto-generate short link key for new linksuseEffect(() => {- const name = session?.user?.name;-- if (!key && name && !keyInputFocused && !isLoading) {- const namePrefix = name.split(" ")[0];- const randomSuffix = nanoid(4).toLowerCase();- const generatedKey = `${namePrefix}-${randomSuffix}`;- setValue("key", generatedKey.toLowerCase(), { shouldDirty: false });+ if (!key && !keyInputFocused && !isLoading) {+ setValue("key", nanoid(7), { shouldDirty: false });}- }, [key, session, setValue, keyInputFocused, isLoading]);+ }, [key, setValue, keyInputFocused, isLoading]);useEffect(() => {if (!selectedAdditionalLink || isEditingLink) {