Skip to content

The VS Code of video editing, built for agents.

TypeScript

Implement upgrade dialog visibility control in purchase success component

konstantin-paulus2c536d913dbe
diff --git a/apps/web/src/components/purchase-success.tsx b/apps/web/src/components/purchase-success.tsx
index fba1d5d4..eb5ed608 100644
--- a/apps/web/src/components/purchase-success.tsx
+++ b/apps/web/src/components/purchase-success.tsx
@@ -9,6 +9,7 @@ import type { Accessor } from "solid-js";
import type { PaidPlan } from "@diffusionstudio/api-contract";
import { Button } from "@/components/ui/button";
+import { hideUpgradeDialog } from "@/components/upgrade-dialog";
import { Dialog, DialogContent, DialogPortal } from "@/components/ui/dialog";
import { useAuth } from "@/context/auth";
import { track } from "@/lib/analytics";
@@ -151,6 +152,7 @@ export function PurchaseSuccess() {
const show = (next: Purchase) => {
setPurchase(next);
+ hideUpgradeDialog();
setOpen(true);
auth.refreshAccount();
track("purchase_success_viewed", {
diff --git a/apps/web/src/components/upgrade-dialog.tsx b/apps/web/src/components/upgrade-dialog.tsx
index 99ad7180..98b9db64 100644
--- a/apps/web/src/components/upgrade-dialog.tsx
+++ b/apps/web/src/components/upgrade-dialog.tsx
@@ -39,6 +39,10 @@ export function showUpgradeDialog() {
}
}
+export function hideUpgradeDialog() {
+ setOpen(false);
+}
+
function formatCredits(value: number): string {
return value.toLocaleString();
}