From 04ca2c35bb6c97305e1d9ed25aa64d3d369126df Mon Sep 17 00:00:00 2001 From: supraja-968 Date: Wed, 31 Jul 2024 17:41:12 +0200 Subject: [PATCH] experiment page to redirect to subscribe instead of checkout --- .../(experiment)/(forms)/NewExperimentForm.tsx | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/frontend/app/experiments/(experiment)/(forms)/NewExperimentForm.tsx b/frontend/app/experiments/(experiment)/(forms)/NewExperimentForm.tsx index 86bb7e85..aefba6f6 100644 --- a/frontend/app/experiments/(experiment)/(forms)/NewExperimentForm.tsx +++ b/frontend/app/experiments/(experiment)/(forms)/NewExperimentForm.tsx @@ -107,21 +107,8 @@ export default function NewExperimentForm({ task }: { task: any }) { toast.error("Failed to start experiment"); } } else { - // Paid tier user without active subscription, initiate checkout process - const result = await dispatch(addExperimentWithCheckoutThunk(transformedPayload)).unwrap(); - if (result.checkout) { - // User needs to subscribe, redirect to checkout - window.location.href = result.checkout.url; - } else if (result && result.ID) { - // Experiment was created successfully (this case might not occur for non-subscribed users) - console.log("Experiment created", result); - router.push(`/experiments/${result.ID}`, { scroll: false }); - dispatch(experimentListThunk(walletAddress)); - toast.success("Experiment started successfully"); - } else { - console.log("Something went wrong", result); - toast.error("Failed to start experiment"); - } + // Paid tier user without active subscription, redirect to subscription page + router.push('/subscribe'); } } else { console.error("Invalid user tier");