The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
final touches
Steven Tey80fb8213b2dc
diff --git a/apps/web/ui/modals/link-builder/link-preview.tsx b/apps/web/ui/modals/link-builder/link-preview.tsxindex 799c94a924..36bd58abc7 100644--- a/apps/web/ui/modals/link-builder/link-preview.tsx+++ b/apps/web/ui/modals/link-builder/link-preview.tsx@@ -280,8 +280,8 @@ function DefaultOGPreview({ title, description, children }: OGPreviewProps) {value={title || "Add a title..."}maxRows={2}onChange={(e) => {- setValue("title", e.currentTarget.value);- setValue("proxy", true);+ setValue("title", e.currentTarget.value, { shouldDirty: true });+ setValue("proxy", true, { shouldDirty: true });}}/><ReactTextareaAutosize@@ -289,8 +289,10 @@ function DefaultOGPreview({ title, description, children }: OGPreviewProps) {value={description || "Add a description..."}maxRows={2}onChange={(e) => {- setValue("description", e.currentTarget.value);- setValue("proxy", true);+ setValue("description", e.currentTarget.value, {+ shouldDirty: true,+ });+ setValue("proxy", true, { shouldDirty: true });}}/></div>@@ -318,8 +320,10 @@ function FacebookOGPreview({className="truncate border-none bg-transparent p-0 text-xs font-semibold text-[#1d2129] outline-none focus:ring-0"value={title || "Add a title..."}onChange={(e) => {- setValue("title", e.currentTarget.value);- setValue("proxy", true);+ setValue("title", e.currentTarget.value, {+ shouldDirty: true,+ });+ setValue("proxy", true, { shouldDirty: true });}}/><ReactTextareaAutosize@@ -327,8 +331,10 @@ function FacebookOGPreview({value={description || "Add a description..."}maxRows={2}onChange={(e) => {- setValue("description", e.currentTarget.value);- setValue("proxy", true);+ setValue("description", e.currentTarget.value, {+ shouldDirty: true,+ });+ setValue("proxy", true, { shouldDirty: true });}}/></div>@@ -355,8 +361,10 @@ function LinkedInOGPreview({ title, hostname, children }: OGPreviewProps) {value={title || "Add a title..."}maxRows={2}onChange={(e) => {- setValue("title", e.currentTarget.value);- setValue("proxy", true);+ setValue("title", e.currentTarget.value, {+ shouldDirty: true,+ });+ setValue("proxy", true, { shouldDirty: true });}}/><p className="text-xs text-[#00000099]">{hostname || "domain.com"}</p>diff --git a/apps/web/ui/modals/link-builder/og-modal.tsx b/apps/web/ui/modals/link-builder/og-modal.tsxindex 66a6101a1a..4e09bc3651 100644--- a/apps/web/ui/modals/link-builder/og-modal.tsx+++ b/apps/web/ui/modals/link-builder/og-modal.tsx@@ -438,6 +438,10 @@ function OGModalInner({className="text-xs font-medium text-gray-700 transition-colors hover:text-gray-950"onClick={() => {setValueParent("proxy", false, { shouldDirty: true });+ ["title", "description", "image"].forEach(+ (key: "title" | "description" | "image") =>+ setValueParent(key, null, { shouldDirty: true }),+ );setShowOGModal(false);}}>diff --git a/apps/web/ui/modals/link-builder/password-modal.tsx b/apps/web/ui/modals/link-builder/password-modal.tsxindex f464229ccd..9de5c3dd11 100644--- a/apps/web/ui/modals/link-builder/password-modal.tsx+++ b/apps/web/ui/modals/link-builder/password-modal.tsx@@ -179,6 +179,10 @@ function PasswordModalInner({className="text-xs font-medium text-gray-700 transition-colors hover:text-gray-950"onClick={() => {setValueParent("password", null, { shouldDirty: true });+ ["title", "description", "image"].forEach(+ (key: "title" | "description" | "image") =>+ setValueParent(key, null, { shouldDirty: true }),+ );setShowPasswordModal(false);}}>diff --git a/apps/web/ui/modals/link-builder/use-metatags.ts b/apps/web/ui/modals/link-builder/use-metatags.tsindex c403a9f63b..83984f1352 100644--- a/apps/web/ui/modals/link-builder/use-metatags.ts+++ b/apps/web/ui/modals/link-builder/use-metatags.ts@@ -44,6 +44,11 @@ export function useMetatags({* - url is not empty**/if (enabled) {+ if (!proxy) {+ setValue("title", null);+ setValue("description", null);+ setValue("image", null);+ }try {// if url is valid, continue to generate metatags, else return nullnew URL(debouncedUrl);@@ -51,10 +56,10 @@ export function useMetatags({fetch(`/api/metatags?url=${debouncedUrl}`).then(async (res) => {if (res.status === 200) {const results = await res.json();- !title && setValue("title", truncate(results.title, 120));- !description &&+ if (!title) setValue("title", truncate(results.title, 120));+ if (!description)setValue("description", truncate(results.description, 240));- !image && setValue("image", results.image);+ if (!image) setValue("image", results.image);}// set timeout to prevent flickeringsetTimeout(() => setGeneratingMetatags(false), 200);