From d839195ad2547c25d22559345306f1f8aa80fb60 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 17 Apr 2026 22:07:55 +0100 Subject: [PATCH] refactor: clean up --- apps/web/src/components/NewWorkspaceForm.tsx | 36 ------------------- .../members/components/InviteMemberForm.tsx | 2 +- .../components/UpgradeToProConfirmation.tsx | 2 ++ 3 files changed, 3 insertions(+), 37 deletions(-) diff --git a/apps/web/src/components/NewWorkspaceForm.tsx b/apps/web/src/components/NewWorkspaceForm.tsx index 70d501cf..5f4b41d3 100644 --- a/apps/web/src/components/NewWorkspaceForm.tsx +++ b/apps/web/src/components/NewWorkspaceForm.tsx @@ -114,42 +114,6 @@ export function NewWorkspaceForm() { weekStartDay: 1, }); - // If in cloud and Pro toggle is enabled, create checkout session for pro - if (env("NEXT_PUBLIC_KAN_ENV") === "cloud" && isProToggleEnabled) { - try { - const response = await fetch( - "/api/stripe/create_checkout_session", - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - slug: slug || undefined, - workspacePublicId: values.publicId, - cancelUrl: window.location.pathname + window.location.search, - successUrl: "/boards", - }), - }, - ); - - const data = await response.json(); - const url = (data as { url: string }).url; - - if (url) { - window.location.href = url; - return; // Don't close modal if redirecting to checkout - } - } catch (error) { - console.error("Error creating checkout session:", error); - showPopup({ - header: t`Error upgrading to Pro`, - message: t`Workspace created successfully. You can upgrade later in settings.`, - icon: "warning", - }); - } - } - closeModal(); } }, diff --git a/apps/web/src/views/members/components/InviteMemberForm.tsx b/apps/web/src/views/members/components/InviteMemberForm.tsx index 00da7603..95ab9fe7 100644 --- a/apps/web/src/views/members/components/InviteMemberForm.tsx +++ b/apps/web/src/views/members/components/InviteMemberForm.tsx @@ -341,7 +341,7 @@ export function InviteMemberForm({ )} -
+