The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
fix clear link filter bug
Steven Teyb9f35727a856
diff --git a/apps/web/ui/modals/add-edit-link-modal/index.tsx b/apps/web/ui/modals/add-edit-link-modal/index.tsxindex 5872f5f0a6..8fc6bd07c6 100644--- a/apps/web/ui/modals/add-edit-link-modal/index.tsx+++ b/apps/web/ui/modals/add-edit-link-modal/index.tsx@@ -321,7 +321,6 @@ function AddEditLinkModal({const [lockKey, setLockKey] = useState(true);- const welcomeFlow = pathname === "/welcome";const keyRef = useRef<HTMLInputElement>(null);useEffect(() => {if (key?.endsWith("-copy")) {@@ -351,9 +350,7 @@ function AddEditLinkModal({className="max-w-screen-lg"preventDefaultClose={homepageDemo ? false : true}onClose={() => {- if (welcomeFlow) {- router.back();- } else if (searchParams.has("newLink")) {+ if (searchParams.has("newLink")) {queryParams({del: ["newLink", "newLinkDomain"],});@@ -361,7 +358,7 @@ function AddEditLinkModal({}}><div className="scrollbar-hide grid max-h-[95vh] w-full divide-x divide-gray-100 overflow-auto md:grid-cols-2 md:overflow-hidden">- {!welcomeFlow && !homepageDemo && (+ {!homepageDemo && (<buttononClick={() => {setShowAddEditLinkModal(false);@@ -414,11 +411,6 @@ function AddEditLinkModal({undefined,{ revalidate: true },);- // for welcome page, redirect to links page after adding a link- if (pathname === "/welcome") {- router.push("/links");- setShowAddEditLinkModal(false);- }const data = await res.json();// copy shortlink to clipboard when adding a new linkif (!props) {@@ -436,7 +428,9 @@ function AddEditLinkModal({toast.success("Successfully updated shortlink!");}setShowAddEditLinkModal(false);- router.push(`/${slug}`);+ if (pathname !== `/${slug}`) {+ router.push(`/${slug}`);+ }} else {const { error } = await res.json();if (error) {